Question for those developing GUI apps with Ruby

Discussion in 'Ruby' started by Karl von Laudermann, May 17, 2007.

  1. This is a question for those of you who use Ruby to develop GUI-based
    applications, using wxWidgets, or Qt, or GTK, etc. and the appropriate
    Ruby bindings.

    My question is, how do you actually package and distribute your
    application to end users, and what do you distribute vs. require the
    user to already install? For example, do you just distribute your .rb
    files, and then tell the user:
    "To run this app, you have to have Ruby installed on your machine,
    PLUS wxWidgets, PLUS wxRuby."?

    Or is there a way to package and distribute the wxWidgets (or Qt or
    GTK or Fox) library and the Ruby bindings along with your app's Ruby
    sources so that your only end user system requirement is Ruby? And if
    you do redistribute the GUI library and the Ruby bindings, do you have
    to install them into the System somehow, or modify paths and/or
    environment variables to make sure they're "installed" properly? Or
    can you have everything in a single folder along side your app's
    sources, so everything is nicely self-contained without the user
    needing to modify their system?

    So far the only method of creating GUI apps with Ruby that I've played
    around with at all is JRuby, because as I understand it I can make it
    so that the only end user requirement is that they have Java
    installed, by distributing jruby-complete.jar along with my app's .rb
    source files, plus maybe a .bat or shell script file to launch the
    app. And on the Mac you could probably package that all up as a .app
    bundle, so the user can just double click it and go, without having to
    install anything else (since Macs come with Java installed).
     
    Karl von Laudermann, May 17, 2007
    #1
    1. Advertisements

  2. Have you looked at rubyscript2exe? That way, not even ruby is a requirement.
     
    Joel VanderWerf, May 17, 2007
    #2
    1. Advertisements

  3. Karl von Laudermann

    David Mullet Guest

    I heartily recommend Erik Veenstra's RubyScript2Exe:

    http://www.erikveen.dds.nl/rubyscript2exe/index.html

    It works well for me, and is well documented and supported. I use it on
    Windows and distribute wxRuby apps for use on dozens of PCs without a
    problem. It works for Mac and Linux, as well. As Joel said, Ruby doesn't
    need to be installed on the user's machine.

    David

    http://rubyonwindows.blogspot.com
     
    David Mullet, May 17, 2007
    #3
  4. Thanks for the reply. I had looked into RubyScript2Exe in the past. I
    thought it was Windows only, though. Maybe it was back then, or maybe
    I just assumed it was based on the name. I also didn't know you could
    use it to package up wxWidgets and wxRuby with your app.

    The one thing that concerns me as I skim the web site is that they
    keep saying "Darwin" when they talk about Mac OS X. Usually this is a
    sign that the software in question runs on the Mac as just another
    flavor of UNIX, from the terminal, rather than as a Mac-like double-
    clickable application icon. Although once you've created your
    executable, there's probably a simple way to wrap it up into a .app
    bundle using Apple's developer tools.

    ....oops, I just saw this part:

    "Don't rely on shared libraries which are not part of the Ruby
    environment. Unless you are absolutely sure your customer has
    installed these libraries. For example: the Ruby bindings for TK are
    considered to be part of your Ruby environment, TK itself isn't. For
    that reason, I like RubyWebDialogs (pure Ruby!) and WxRuby (native
    widgets)."

    It appears that wxRuby is a self-contained gem with no external
    dependencies, and not just a binding separate from the wxWidgets
    library. But is this true about the Ruby bindings for Qt and GTK as
    well? If not, then apparently you can't use them with RubyScript2Exe.
    So if I decide to try playing with RubyScript2Exe, that means that I'm
    forced to choose wxWidgets, correct?

    So how do Ruby Qt and GTK developers distribute their apps?

    Not trying to be a pain, just trying to get a broad understanding.
    Thanks for any insight you can share.
     
    Karl von Laudermann, May 18, 2007
    #4
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.