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

M

Markus Fischer

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
 
M

Markus Fischer

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
 
M

Mohammed Rashad

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

try FXRuby
 
Q

Quintus

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

Am 20.09.2010 01:18, schrieb Markus Fischer:
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
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-----
 
B

Benoit Daloze

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.
 
M

Markus Fischer

Hi,

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
 
M

Markus Fischer

Hi,

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
 
M

Markus Fischer

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
 
M

Martin DeMello

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
 
D

Diego Viola

[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.

 
L

Luis Lavena

[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.
 
D

Diego Viola

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

[diego@myhost 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:in `require'
from main.rb:27:in `<main>'
[diego@myhost pixelator]$


[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.
 
R

Ryan Melton

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

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
 
R

Ryan Melton

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

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,

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
 
D

Diego Viola

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

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

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,

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top