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

Discussion in 'Ruby' started by Markus Fischer, Sep 20, 2010.

  1. 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
     
    Markus Fischer, Sep 20, 2010
    #1
    1. Advertising

  2. On 20.09.2010 01:14, Markus Fischer 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
     
    Markus Fischer, Sep 20, 2010
    #2
    1. Advertising

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

    try FXRuby

    On Mon, Sep 20, 2010 at 4:48 AM, Markus Fischer <> wrote:

    > On 20.09.2010 01:14, Markus Fischer 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
    >
    >



    --
    Rashad
     
    Mohammed Rashad, Sep 20, 2010
    #3
  4. Hi,

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

    Markus Fischer wrote:
    > On 20.09.2010 01:14, Markus Fischer 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.
    --
    Posted via http://www.ruby-forum.com/.
     
    Chauk-Mean Proum, Sep 20, 2010
    #4
  5. Markus Fischer

    Quintus Guest

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

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

    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-----
     
    Quintus, Sep 20, 2010
    #5
  6. Markus Fischer

    Ryan Melton Guest

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

    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 Mon, Sep 20, 2010 at 8:47 AM, Quintus <> wrote:

    > -----BEGIN PGP SIGNED MESSAGE-----
    > Hash: SHA1
    >
    > Am 20.09.2010 01:18, schrieb Markus Fischer:
    > > On 20.09.2010 01:14, Markus Fischer 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
    > >
    > >

    > 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-----
    >
    >
     
    Ryan Melton, Sep 21, 2010
    #6
  7. On 21.09.2010 05:41, Ryan Melton 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
     
    Markus Fischer, Sep 21, 2010
    #7
  8. On 21 September 2010 05:41, Ryan Melton <> 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.
     
    Benoit Daloze, Sep 21, 2010
    #8
  9. wxruby-ruby1.9 works (wa: Re: Getting GUI for ruby for Linux running(QT or wxWidget)?)

    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
     
    Markus Fischer, Sep 21, 2010
    #9
  10. QT works! (was: Re: Getting GUI for ruby for Linux running (QT orwxWidget))

    Hi,

    On 21.09.2010 05:41, Ryan Melton 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
     
    Markus Fischer, Sep 21, 2010
    #10
  11. Re: QT works!

    On 21.09.2010 18:48, Markus Fischer wrote:
    > On 21.09.2010 05:41, Ryan Melton 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
     
    Markus Fischer, Sep 21, 2010
    #11
  12. Re: QT works!

    On Tue, Sep 21, 2010 at 11:11 PM, Markus Fischer <> 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
     
    Martin DeMello, Sep 21, 2010
    #12
  13. Re: QT works!

    On 21 September 2010 21:52, Martin DeMello <> wrote:
    > On Tue, Sep 21, 2010 at 11:11 PM, Markus Fischer <> 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!
     
    Benoit Daloze, Sep 21, 2010
    #13
  14. Markus Fischer

    Diego Viola Guest

    Re: QT works!

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

    On Tue, Sep 21, 2010 at 4:03 PM, Benoit Daloze <> wrote:

    > On 21 September 2010 21:52, Martin DeMello <>
    > wrote:
    > > On Tue, Sep 21, 2010 at 11:11 PM, Markus Fischer <>

    > 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!
    >
    >
     
    Diego Viola, Sep 21, 2010
    #14
  15. Re: QT works!

    On 22.09.2010 00:31, Diego Viola 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
     
    Markus Fischer, Sep 22, 2010
    #15
  16. Markus Fischer

    Luis Lavena Guest

    Re: QT works!

    On Sep 21, 7:31 pm, Diego Viola <> 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.

    --
    Luis Lavena
     
    Luis Lavena, Sep 22, 2010
    #16
  17. Markus Fischer

    Diego Viola Guest

    Re: QT works!

    [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]$


    On Tue, Sep 21, 2010 at 8:10 PM, Luis Lavena <> wrote:

    > On Sep 21, 7:31 pm, Diego Viola <> 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.
    >
    > --
    > Luis Lavena
    >
    >
     
    Diego Viola, Sep 22, 2010
    #17
  18. Markus Fischer

    Ryan Melton Guest

    Re: QT works!

    [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

    On Tue, Sep 21, 2010 at 11:41 AM, Markus Fischer <>wrote:

    > On 21.09.2010 18:48, Markus Fischer wrote:
    > > On 21.09.2010 05:41, Ryan Melton 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
    >
    >
     
    Ryan Melton, Sep 22, 2010
    #18
  19. Markus Fischer

    Ryan Melton Guest

    Re: QT works! (was: Re: Getting GUI for ruby for Linux running (QTor wxWidget))

    [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

    On Tue, Sep 21, 2010 at 10:48 AM, Markus Fischer <>wrote:

    > Hi,
    >
    > On 21.09.2010 05:41, Ryan Melton 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
    >
    >
     
    Ryan Melton, Sep 22, 2010
    #19
  20. Markus Fischer

    Diego Viola Guest

    Re: QT works! (was: Re: Getting GUI for ruby for Linux running (QTor wxWidget))

    [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

    On Tue, Sep 21, 2010 at 10:32 PM, Ryan Melton <> wrote:

    > 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
    >
    > On Tue, Sep 21, 2010 at 10:48 AM, Markus Fischer <
    > >wrote:

    >
    > > Hi,
    > >
    > > On 21.09.2010 05:41, Ryan Melton 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
    > >
    > >

    >
     
    Diego Viola, Sep 22, 2010
    #20
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve Jasper
    Replies:
    0
    Views:
    3,039
    Steve Jasper
    Nov 20, 2003
  2. refreshing a wxWidget

    , Aug 19, 2004, in forum: Python
    Replies:
    0
    Views:
    310
  3. Replies:
    2
    Views:
    631
  4. rfasuma
    Replies:
    1
    Views:
    564
    Lionel B
    Feb 25, 2008
  5. Flaab Mrlinux

    [Gui] Which GUI is available with Ruby?

    Flaab Mrlinux, Nov 15, 2006, in forum: Ruby
    Replies:
    3
    Views:
    137
    WoodHacker
    Nov 15, 2006
Loading...

Share This Page