Getting GUI for ruby for Linux running (QT or wxWidget)?

Hi,

I’m trying to evaluate GUI development with Ruby on Linux and Windows
and currently I decided to try QT and wxWdigets.

Seems it’s not my weekend, I really tried for hours, various attempts
and I could get neither running. I started with Ubuntu 10.10 64bit off
first, not yet settled on the Windows side.

QT:
First struggled to realized there’s not gem for it. Downloaded the
sources from
http://rubyforge.org/frs/download.php/71843/qt4-qtruby-2.1.0.tar.gz and
now I’m sitting there and I’ve no idea what to do. The included INSTALL
refers to http://techbase.kde.org/Getting_Started/Build/KDE4 which has
no mentions of ruby whatsoever. The README in contrast gave some
insights and “Install examples”, ultimatively I figured I just need to
run “cmake .”. However it quit with “Could not find Ruby” but ruby is
installed (1.9.1p378 via rvm). I gave up (no idea how to work this out
with cmake, never used it).

wxWidgets:
With joy I started because I saw wxruby gem, installation goes fine but
fails with

`require’: libwx_gtk2u_media-2.8.so.0: cannot open shared object file:
No such file or directory

After some googling I came to the conclusion that I’m out of luck as the
wxwidgets provided by Ubuntu seem to miss this feature. No idea I
thought, I can role my own wxwidgets, no? So I downloaded latest source,
but couldn’t compile it because it requires swig 1.3.38 but Ubuntu ships
with 1.3.40. Downloaded and tried to compile swig 1.3.38 but it failed
with:

Modules/swigmod.h:20: error: redeclaration of C++ built-in type ‘bool’

No idea how something like this can happen, so I stopped here. I thought
maybe Ubuntu 10.10 is too new (it’s still beta after all) so I installed
10.04 and I could compile swig 1.3.38 there but failed at compiling
wxwidgets right before the final linking stage (I was almost there!):

/usr/bin/ld: cannot find -lgtk-x11-2.0

No idea why it requires a file not being there or where this file could
be (no result from “apt-cache search” or packages.debian.org ) ->
another dead end.

So what I started out as “must be a piece of cake” turned out to be
hours of hours trying various things without outcome. What are you using
when you say you’ve QT or wxWidgets questions? Which distributions and
which Ruby versions are you running?

I’m thankful for any advice for the aforementioned problems.

thx,

  • Markus

On 20.09.2010 01:14, Markus F. wrote:

10.04 and I could compile swig 1.3.38 there but failed at compiling
wxwidgets right before the final linking stage (I was almost there!):

/usr/bin/ld: cannot find -lgtk-x11-2.0

There’s a slight but important to note error here: of course I didn’t
try to compile wxwidgets (there’s a ready package from Ubuntu there
already!) but wxruby which failed at the end.

  • Markus

try FXRuby

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 20.09.2010 01:18, schrieb Markus F.:

  • Markus

wxRuby doesn’t work out of the box with Ubuntu 9.10 and newer, because
Ubuntu switched to GCC 4 I think. There are build instruction available
at
http://wxruby.rubyforge.org/wiki/wiki.pl?BuildingOnTopOfLinuxDistroPackages
which work quite well for me, because I already compile all my Ruby
installations myself. Adding an extra switch to Ruby’s ./configure was
not that hard therefore, but I’m not sure if the Ruby provided in the
Ubuntu repositories was compiled with --enable-shared.
However, I’m working on another GUI project that uses wxRuby, and
published compiled wxRubies for 32 and 64 bit for use with Ruby
1.9.2-p0. They’re available from
http://github.com/Quintus/OpenRubyRMK/downloads . However, they’re
untested, so I’d be glad if you could report wheather they work or
don’t.

Vale,
Marvin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyXdAoACgkQDYShvwAbcNkprACfS3yD2J1d5HIMSewb8JI8Ly8W
EUwAnAlSsJxRwwtTmny4UnG7LQ0HPGma
=/M54
-----END PGP SIGNATURE-----

qt does have a new gem I put together:
gem install qtbindings

See the github page and make sure you have all the dependencies before
installing:
http://github.com/ryanmelt/qtbindings

On 21.09.2010 05:41, Ryan M. wrote:

qt does have a new gem I put together:
gem install qtbindings

See the github page and make sure you have all the dependencies before
installing:
http://github.com/ryanmelt/qtbindings

That sounds great, I’ll test that for sure when I’m home later. Thanks
in advance!

  • Markus

On 21 September 2010 05:41, Ryan M. [email protected] wrote:

qt does have a new gem I put together:
gem install qtbindings

See the github page and make sure you have all the dependencies before
installing:
http://github.com/ryanmelt/qtbindings

Yeah, that’s quite cool.
But you absolutely need the MacPorts Qt (as recommended) (Homebrew or
binary did not work for me).

I’m trying to evaluate GUI development with Ruby on Linux and Windows
and currently I decided to try QT and wxWdigets.

The QtRuby API is really nice, so I would recommend you Qt.

I finally was able to install QtRuby a few days ago, and I’m really
enjoying it.
I installed on OSX, so I do not know about other platforms, but I
believe the instructions from the qtbindings gem, so it should be
relatively easy.

Regards,
B.D.

Hi,

On 20.09.2010 16:47, Quintus wrote:

wxRuby doesn’t work out of the box with Ubuntu 9.10 and newer, because
Ubuntu switched to GCC 4 I think.

Finally I got it working on Ubuntu 10.04 64bit!

Your post indirectly helped me, because I simply didn’t realized there
was an wxruby-ruby19 package and I am using ruby 1.9.something.

I tried one of the examples and it instantly worked.

wxruby requires “libwx_gtk2u_media-2.8.so.0” which is available on 10.04
but not on 10.10 (which I initially tried, leave alone I tried the
wrong version).

I’m wondering why the gem did let me install a version it doesn’t work
it, i.e. some kind of ruby version dependency.

thanks for the help!

  • Markus

Hi,

The following link may help you :
http://wxruby.rubyforge.org/wiki/wiki.pl?BuildingOnTopOfLinuxDistroPackages

Markus F. wrote:

On 20.09.2010 01:14, Markus F. wrote:

10.04 and I could compile swig 1.3.38 there but failed at compiling
wxwidgets right before the final linking stage (I was almost there!):

/usr/bin/ld: cannot find -lgtk-x11-2.0

There’s a slight but important to note error here: of course I didn’t
try to compile wxwidgets (there’s a ready package from Ubuntu there
already!) but wxruby which failed at the end.

Chauk-Mean.

Hi,

On 21.09.2010 05:41, Ryan M. wrote:

qt does have a new gem I put together:
gem install qtbindings

See the github page and make sure you have all the dependencies before
installing:
http://github.com/ryanmelt/qtbindings

Works great! Once I figured all packages I needed it worked out of the
bugs in Ubuntu 10.04 64bit, minus the KNOWN_ISSUES.txt things.

On Ubuntu 10.10 64b it stops with this error:

cp: cannot stat `ext/build/smoke/qtmultimedia/libsmokeqtmultimedia.*’:
No such file or directory
make: *** [install] Error 1

thanks,

  • Markus

On Tue, Sep 21, 2010 at 11:11 PM, Markus F. [email protected]
wrote:

Same on Windows 7 Pro 64bit, worked out of the box with Ruby191 .

Beautiful! I’ve missed the Qt bindings ever since I made the shift to
1.9

I must say I’m really impressed how flawless this worked, compared to
anything I tried during the weekend. It’s exactly what I hoped for,
because e.g. I was looking at python qt bindings before last weekend and
it was also like a breeze to install and I just wished this would be
available for ruby too … now it is.

Seconded. Excellent work, Ryan. Will see if I can get it running on
the N900 too.

martin

On 21.09.2010 18:48, Markus F. wrote:

On 21.09.2010 05:41, Ryan M. wrote:

qt does have a new gem I put together:
gem install qtbindings

See the github page and make sure you have all the dependencies before
installing:
http://github.com/ryanmelt/qtbindings

Works great! Once I figured all packages I needed it worked out of the
bugs in Ubuntu 10.04 64bit, minus the KNOWN_ISSUES.txt things.

Same on Windows 7 Pro 64bit, worked out of the box with Ruby191 .

I must say I’m really impressed how flawless this worked, compared to
anything I tried during the weekend. It’s exactly what I hoped for,
because e.g. I was looking at python qt bindings before last weekend and
it was also like a breeze to install and I just wished this would be
available for ruby too … now it is.

thanks again,

  • Markus

I tried this but I get some require errors with Ruby 1.9.2. It works if
I
modify the requires with a ./ at the front.

On 21 September 2010 21:52, Martin DeMello [email protected]
wrote:

On Tue, Sep 21, 2010 at 11:11 PM, Markus F. [email protected] wrote:

Same on Windows 7 Pro 64bit, worked out of the box with Ruby191 .

Beautiful! I’ve missed the Qt bindings ever since I made the shift to 1.9

Me too!

On 22.09.2010 00:31, Diego V. wrote:

I tried this but I get some require errors with Ruby 1.9.2. It works if I
modify the requires with a ./ at the front.

Is this related to

“$: no longer includes the current directory.”

from http://www.ruby-lang.org/en/news/2010/08/18/ruby-1-9-2-is-released/

?

If so, is there a way to tell the calling binary to include the current
path, i.e. outside the script? Like ruby
“whatever_it_takes_to_incldue_.” script.rb ?

  • Markus

[[email protected] pixelator]$ ruby -I. main.rb
internal:lib/rubygems/custom_require:29:in require': no such file to load -- qrc_images.rb (LoadError) from <internal:lib/rubygems/custom_require>:29:inrequire’
from main.rb:27:in `’
[[email protected] pixelator]$

On Sep 21, 7:31 pm, Diego V. removed_ema[email protected] wrote:

[Note: parts of this message were removed to make it a legal post.]

I tried this but I get some require errors with Ruby 1.9.2. It works if I
modify the requires with a ./ at the front.

I think the question was: Have you tried include the current
directory?

ruby -I. my_script.rb

That should restore Ruby pre-1.9.2 behavior of having the current
directory available.

Thanks for the feedback guys. I’ll update the examples tonight to
handle
the current directory not being in the path on 1.9.2.
Ryan

Thanks for the feedback. I’ll work on the issues with Ubuntu 10.10 once
it
gets out of beta. For now I’m working on killing all the bugs in
KNOWN_ISSUES.txt.
Ryan

Hi Ryan,

Some examples failed to run due to a few syntax errors so I fixed some
of
them. I send you a pull request.

Best Regards,

Diego

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs