Professional Web Applications Themes

Distributing Ruby applications - Ruby

Hello Rubyists, I was hoping to hear some thoughts on the distribution of applications made with Ruby. Say I make a GUI app with wxRuby. I am not guaranteed that the user will have wxRuby, or even have Ruby at all. I want to make it as easy as possible for other people to run it. I thought that I could distribute my app as a zip file which would contain a copy of ruby for the intended platform, as well as all the libraries, and of course my Ruby program. The zip would also contain a shell script which ...

  1. #1

    Default Distributing Ruby applications

    Hello Rubyists,

    I was hoping to hear some thoughts on the distribution of applications
    made with Ruby. Say I make a GUI app with wxRuby. I am not guaranteed
    that the user will have wxRuby, or even have Ruby at all. I want to make
    it as easy as possible for other people to run it.

    I thought that I could distribute my app as a zip file which would
    contain a copy of ruby for the intended platform, as well as all the
    libraries, and of course my Ruby program. The zip would also contain a
    shell script which would set up the appropriate Ruby environment and run
    the application. Something like this:

    #/bin/sh
    #
    # myprogram -- This is the file that the user actually runs.

    RUBYLIB="."
    PATH="."

    ruby my_ruby_prog.rb


    I'm sure that it's possible to do something like that for Windows also.

    The user would simply unzip the file and click on "myprogram", which is
    the above shell script. So it would be a zero-install program.

    Would this work the way I expect?

    My distribution zip file could contain a directory for every platform that
    is supported.

    Thoughts?
    --
    Daniel Carrera | PGP: 6643 8C8B 3522 66CB D16C D779 2FDD 7DAC 9AF7 7A88
    Math PhD. UMD | [url]http://www.math.umd.edu/~dcarrera/pgp.html[/url]

    Weekly Smile:
    There are 10 types of people in the world...
    Those who understand binary - and those who don't.

    Daniel Carrera Guest

  2. #2

    Default Re: Distributing Ruby applications

    Daniel Carrera wrote:
    >
    > Hello Rubyists,
    >
    > I was hoping to hear some thoughts on the distribution of applications
    > made with Ruby. Say I make a GUI app with wxRuby. I am not guaranteed
    > that the user will have wxRuby, or even have Ruby at all. I want to make
    > it as easy as possible for other people to run it.
    >
    > I thought that I could distribute my app as a zip file which would
    > contain a copy of ruby for the intended platform, as well as all the
    > libraries, and of course my Ruby program. The zip would also contain a
    > shell script which would set up the appropriate Ruby environment and run
    > the application. Something like this:
    >
    > #/bin/sh
    > #
    > # myprogram -- This is the file that the user actually runs.
    >
    > RUBYLIB="."
    > PATH="."
    >
    > ruby my_ruby_prog.rb
    >
    >
    > I'm sure that it's possible to do something like that for Windows also.
    I already do this for the Windows distribution of FreeRIDE, except that I
    use the NSIS installer instead of a zip file. This gives me more control
    than I can get with a zip file.

    Curt
    > The user would simply unzip the file and click on "myprogram", which is
    > the above shell script. So it would be a zero-install program.
    >
    > Would this work the way I expect?
    >
    > My distribution zip file could contain a directory for every
    > platform that
    > is supported.
    >
    > Thoughts?
    > --
    > Daniel Carrera | PGP: 6643 8C8B 3522 66CB D16C D779 2FDD 7DAC 9AF7 7A88
    > Math PhD. UMD | [url]http://www.math.umd.edu/~dcarrera/pgp.html[/url]
    >
    > Weekly Smile:
    > There are 10 types of people in the world...
    > Those who understand binary - and those who don't.
    >
    >

    Curt Hibbs Guest

  3. #3

    Default Re: Distributing Ruby applications

    Daniel Carrera [mailto:dcarreramath.umd.edu] wrote:
    > I was hoping to hear some thoughts on the distribution of applications
    > made with Ruby. Say I make a GUI app with wxRuby. I am not guaranteed
    > that the user will have wxRuby, or even have Ruby at all. I want to make
    > it as easy as possible for other people to run it.
    For Windows, I would highly suggest the exerb package.

    [url]http://exerb.sourceforge.jp/index.en.html[/url]

    Very, very nice.


    Nathaniel

    <:((><


    Nathaniel Talbott Guest

  4. #4

    Default Re: Distributing Ruby applications

    On Fri, Aug 08, 2003 at 09:50:40AM +0900, Nathaniel Talbott wrote:
    > For Windows, I would highly suggest the exerb package.
    >
    > [url]http://exerb.sourceforge.jp/index.en.html[/url]
    >
    > Very, very nice.
    Windows is not the only platform I would be interested in supporting. In
    fact, Mac OS X and Linux would rank higher in my list. I guess I can use
    exerb for the Windows version, but I'm still interested in what I can do
    for most operating systems.

    --
    Daniel Carrera | PGP: 6643 8C8B 3522 66CB D16C D779 2FDD 7DAC 9AF7 7A88
    Math PhD. UMD | [url]http://www.math.umd.edu/~dcarrera/pgp.html[/url]

    Weekly Smile:
    There are 10 types of people in the world...
    Those who understand binary - and those who don't.

    Daniel Carrera Guest

  5. #5

    Default Re: Distributing Ruby applications

    Daniel Carrera wrote:
    >
    > On Fri, Aug 08, 2003 at 09:45:39AM +0900, Curt Hibbs wrote:
    >
    > > > I'm sure that it's possible to do something like that for
    > Windows also.
    > >
    > > I already do this for the Windows distribution of FreeRIDE,
    > except that I
    > > use the NSIS installer instead of a zip file. This gives me more control
    > > than I can get with a zip file.
    >
    > What is NSIS? Is that something I can use in most platforms?
    It is an open-source installer for Windows only. It can be found at:

    [url]http://nsis.sourceforge.net/site/index.php[/url]

    Curt


    Curt Hibbs Guest

  6. #6

    Default Re: Distributing Ruby applications

    Curt Hibbs wrote:
    > Daniel Carrera wrote:
    >
    >>What is NSIS? Is that something I can use in most platforms?
    >
    >
    > It is an open-source installer for Windows only. It can be found at:
    >
    > [url]http://nsis.sourceforge.net/site/index.php[/url]
    It's quite tasty, too, though I would highly recommend getting the free
    IDE/form builder thing, HS NIS Edit:
    [url]http://www.geocities.com/hmsoftcr/nisedt.htm[/url]

    Makes it much easier to gget started build scripts and creating custom
    installer screens.

    James
    >
    > Curt
    >
    >
    >



    james_b Guest

  7. #7

    Default Re: Distributing Ruby applications

    You know what would be cool? If one wrote an installer with wxRuby which
    could get run from the configuration script.

    #!/bin/sh
    # installer.sh

    RUBYLIB="."
    PATH="."

    ruby installer.rb


    Then THAT could install Ruby togeter with all the appropriate libraries
    and stuff.

    I once saw a self-extracting Linux program that was essentially a bash
    script with a pile of binary data packed at the end. If I could just
    remember how they did that...

    Well, I'll keep thinking.
    --
    Daniel Carrera | PGP: 6643 8C8B 3522 66CB D16C D779 2FDD 7DAC 9AF7 7A88
    Math PhD. UMD | [url]http://www.math.umd.edu/~dcarrera/pgp.html[/url]

    Weekly Smile:
    There are 10 types of people in the world...
    Those who understand binary - and those who don't.

    Daniel Carrera Guest

  8. #8

    Default Re: Distributing Ruby applications

    On Fri, Aug 08, 2003 at 12:49:14PM +0900, Daniel Carrera wrote:
    > I once saw a self-extracting Linux program that was essentially a bash
    > script with a pile of binary data packed at the end. If I could just
    > remember how they did that...
    You might get some ideas from 'man shar'. shar only works with plain text,
    but I guess you could have a uuencoded tar file or somesuch.

    Regards,

    Brian.

    Brian Candler Guest

  9. #9

    Default Re: Distributing Ruby applications

    > I once saw a self-extracting Linux program that was essentially a bash
    > script with a pile of binary data packed at the end. If I could just
    > remember how they did that...
    >
    > Well, I'll keep thinking.
    [url]http://www.megastep.org/makeself/[/url]

    Try that.
    Zachary P. Landau Guest

  10. #10

    Default Re: Distributing Ruby applications

    Daniel Carrera wrote:
    >
    > You know what would be cool? If one wrote an installer with wxRuby which
    > could get run from the configuration script.
    >
    > #!/bin/sh
    > # installer.sh
    >
    > RUBYLIB="."
    > PATH="."
    >
    > ruby installer.rb
    >
    >
    > Then THAT could install Ruby togeter with all the appropriate libraries
    > and stuff.
    That *would* be really cool!

    I have a desktop GUI app that I've been wanting to create for years that I'm
    going to start on once wxRuby is ready, and a nice cross-platform Ruby-App
    installer would be a nice adjunct to that project -- unless someone else
    does it first. :-)

    Curt


    Curt Hibbs Guest

  11. #11

    Default Re: Distributing Ruby applications

    james_b <james_bneurogami.com> wrote in news:3F331CC3.2060405
    neurogami.com:
    > [url]http://nsis.sourceforge.net/site/index.php[/url]
    There is also Inno Setup:

    [url]http://www.jrsoftware.org/isinfo.php[/url]

    Includes option for full scripting (Pascal like).

    --
    Robert Cowham

    Robert Cowham Guest

  12. #12

    Default Re: Distributing Ruby applications

    Daniel Carrera wrote:
    >Thoughts?
    >
    >
    This is a topic I'm always interested in -- wanted to plug this page:

    [url]http://www.rubygarden.org/ruby?DistributeARubyAppInASingleExecutable[/url]

    --

    Chris
    [url]http://clabs.org/blogki[/url]



    Chris Morris Guest

  13. #13

    Default Re: Distributing Ruby applications

    Nathaniel Talbott wrote:
    >For Windows, I would highly suggest the exerb package.
    >
    >[url]http://exerb.sourceforge.jp/index.en.html[/url]
    >
    >Very, very nice.
    >
    >
    Alrighty - I'm finally getting around to checking it out. I'm trying to
    squeeze this in the cracks of time on the day job -- is there a 'getting
    started with exerb' doc or email discussion anywhere? It appears I need
    to make an .rbc file, but I'm a little sketchy on it. I'll continue
    diving in, but some advance pointers would be nice if anyone's got anything.

    --

    Chris
    [url]http://clabs.org/blogki[/url]



    Chris Morris Guest

  14. #14

    Default Re: Distributing Ruby applications

    Chris Morris [mailto:chrismoclabs.org] wrote:
    > Nathaniel Talbott wrote:
    >
    > >For Windows, I would highly suggest the exerb package.
    >
    > Alrighty - I'm finally getting around to checking it out. I'm trying to
    > squeeze this in the cracks of time on the day job -- is there a 'getting
    > started with exerb' doc or email discussion anywhere? It appears I need
    > to make an .rbc file, but I'm a little sketchy on it. I'll continue
    > diving in, but some advance pointers would be nice if
    > anyone's got anything.
    There are docs in the exerb distribution that outline the basics of it. The
    sourceforge page of the project has the one-liner you need to make an
    initial recipe file:

    $ ruby -r exerb/mkrbc foo.rb

    Works quite well. I have had trouble using YAML with exerb, but haven't had
    a chance to investigate it further. Other than that, everything I've tried
    has worked fine, and I haven't even had to hand-edit the generated recipe
    file.

    The one thing I did that was a bit more complex was to build a new rbx file
    for 1.8.0... but even that wasn't too tough.

    HTH,


    Nathaniel

    <:((><


    Nathaniel Talbott Guest

  15. #15

    Default Re: Distributing Ruby applications

    Curt Hibbs wrote:
    >I'm very interested in this as well, but I don't currently have any time to
    >try it out. So, please continue to post your experience in getting it to
    >work in this thread. I will save it for later use.
    >
    >
    First off, download the main tar.gz (currently
    [url]http://downloads.sourceforge.jp/exerb/4788/exerb-2.6.6.tar.gz[/url]), AFAIK,
    this is the only download that includes the exerb/mkrbc.rb file. I
    started with the
    [url]http://downloads.sourceforge.jp/exerb/4348/exerb-win32-2.6.5.0.zip[/url]
    download, which has only what you need, if you can build your own .rbc
    file yourself.

    So -- download exerb-2.6.6.tar.gz
    <http://downloads.sourceforge.jp/exerb/4788/exerb-2.6.6.tar.gz>, run the
    install.rb file.

    Then run ruby -r exerb/mkrbc yourscripthere.rb

    This will actually execute your script and identify dependencies. It
    creates both a .mak and an .rbc file. The .mak doesn't seem necessary
    for my needs -- my guess it's used to build your final .exe by also
    compiling fresh exerb binaries as well, but you don't need to do that.

    The .rbc file I got looked like this:

    # generated by mkrbc.rb
    kcode none
    script extraction.trace.rb
    script cl/util/console.rb
    c:/ruby/lib/ruby/site_ruby/1.8/cl/util/console.rb
    script sn/util/ado.rb
    c:/ruby/lib/ruby/site_ruby/1.8/sn/util/ado.rb
    script sn/util/db.rb c:/ruby/lib/ruby/site_ruby/1.8/sn/util/db.rb
    library win32ole.so c:/ruby/lib/ruby/1.8/i386-mswin32/win32ole.so

    I wanted to move my .rbc file out of the directory it was made in, so I
    added a full path to extraction.trace.rb:

    # generated by mkrbc.rb
    kcode none
    script extraction.trace.rb c:/dev/projects/tbe/extraction.trace.rb
    script cl/util/console.rb
    c:/ruby/lib/ruby/site_ruby/1.8/cl/util/console.rb
    script sn/util/ado.rb
    c:/ruby/lib/ruby/site_ruby/1.8/sn/util/ado.rb
    script sn/util/db.rb c:/ruby/lib/ruby/site_ruby/1.8/sn/util/db.rb
    library win32ole.so c:/ruby/lib/ruby/1.8/i386-mswin32/win32ole.so

    Then I went back to the directory I installed the
    exerb-win32-2.6.5.0.zip in (sorry if this is a little out of order
    here...), copied in the extraction.trace.rbc file, and ran the
    exerb-win32.exe file. This (no doubt an .exe made from exerb itself) exe
    gives me a GUI where I can choose which .rbx file to use, which .rbc
    file to use and the name of my resulting .exe.

    The .rbx choices:

    ruby168c.rbx this option is console app, single file, large
    ruby168crt.rbx this option is console app, dependent on
    exerb265.dll (included in exerb-win32-2.6.5.0.zip), smaller .exe
    ruby168g.rbx same options as before, GUI app I assume.
    ruby168grt.rbx --

    My first build from the exerb-win32.exe failed, parsing error. I looked
    into the .rbc -- the full path I added needed a tab delimiter to be
    consistent with the other lines generated. I changed that and wha-lah.
    Out comes an .exe.

    Only problem now is my .exe is segfaulting when trying out some win32ole
    stuffs:

    C:\Downloads\exerb-win32-2.6.5.0>extraction.trace.exe
    sn/util/ado.rb:1: [BUG] Segmentation fault
    ruby 1.6.8 (2002-12-24) [i586-mswin32]

    abnormal program termination

    But, this may be expected -- newer 1.8 win32ole.so running with older
    1.6.8. I'll hit up Nathaniel for his 1.8.0.rbx.

    So far -- so good. Seems like stopping down to mess with this is worthwhile.

    --

    Chris
    [url]http://clabs.org/blogki[/url]



    Chris Morris Guest

  16. #16

    Default Re: Distributing Ruby applications

    Nathaniel Talbott wrote:
    >The one thing I did that was a bit more complex was to build a new rbx file
    >for 1.8.0... but even that wasn't too tough.
    >
    Could you slide me a copy? :-)

    --

    Chris
    [url]http://clabs.org/blogki[/url]



    Chris Morris Guest

Similar Threads

  1. Running Java applications with CF applications
    By isleta13 in forum Coldfusion Server Administration
    Replies: 2
    Last Post: March 28th, 12:48 PM
  2. distributing PHP for profit
    By Doug D in forum PHP Development
    Replies: 4
    Last Post: June 15th, 11:05 PM
  3. Enterprise ruby applications
    By Dan North in forum Ruby
    Replies: 2
    Last Post: September 4th, 03:19 PM
  4. [ANN] ruby-freedb, ruby-serialport, ruby-mp3info moved to Rubyforge
    By guillaume.pierronnet@ratp.fr in forum Ruby
    Replies: 0
    Last Post: August 31st, 11:57 PM
  5. Replies: 0
    Last Post: August 21st, 12:11 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139