Ruby distribution woes - bz2 lib and mongrel

Discussion in 'Ruby' started by Stian Haklev, May 15, 2007.

  1. Stian Haklev

    Stian Haklev Guest

    Hi everyone,

    sometimes it really frustrates me that it's so difficult to distribute
    applications written with Ruby. You hack together something quickly that
    works perfectly on your own machine, with all the gems, libraries and
    stuff you've installed... then you want to move it.

    In my concrete case, I'm writing an offline viewer for Wikipedia dump
    files (it's working pretty darn well allready, with repacked files it
    gives me 0.2 second load times from inside a packed file with over 2
    million objects - 7z just spins for minutes). I want to put the dump
    files and this program on a CD / DVD and give it to people, who should
    be able to just do put in the CD, and run it straight off the CD (it's a
    mongrel server that serves content to localhost), whether it's Windows,
    Mac or Linux.

    I've tried with rubyscript2exe, which is a great tool, but it fails
    currently. I think it is because I'm using two C extensions - mongrel
    and the bz2 library. The bz2 is not even a gem, so I don't know how I'd
    compile it for Windows. Any good ideas on best practices for
    distributing this - ideally so that it can run as a "portable app"
    without installation.

    Thank you so much
    Stian

    --
    Posted via http://www.ruby-forum.com/.
    Stian Haklev, May 15, 2007
    #1
    1. Advertising

  2. Stian Haklev

    akbarhome Guest

    On May 15, 10:54 am, Stian Haklev <> wrote:
    > Hi everyone,
    >
    > sometimes it really frustrates me that it's so difficult to distribute
    > applications written with Ruby. You hack together something quickly that
    > works perfectly on your own machine, with all the gems, libraries and
    > stuff you've installed... then you want to move it.
    >
    > In my concrete case, I'm writing an offline viewer for Wikipedia dump
    > files (it's working pretty darn well allready, with repacked files it
    > gives me 0.2 second load times from inside a packed file with over 2
    > million objects - 7z just spins for minutes). I want to put the dump
    > files and this program on a CD / DVD and give it to people, who should
    > be able to just do put in the CD, and run it straight off the CD (it's a
    > mongrel server that serves content to localhost), whether it's Windows,
    > Mac or Linux.
    >
    > I've tried with rubyscript2exe, which is a great tool, but it fails
    > currently. I think it is because I'm using two C extensions - mongrel
    > and the bz2 library. The bz2 is not even a gem, so I don't know how I'd
    > compile it for Windows. Any good ideas on best practices for
    > distributing this - ideally so that it can run as a "portable app"
    > without installation.
    >
    > Thank you so much
    > Stian
    >
    > --
    > Posted viahttp://www.ruby-forum.com/.


    Webrick instead of Mongrel should make more portable.

    If you want Linux guy, Windows guy, Mac guy can access your cd, you
    must supply ruby (and the whole shebangs) in 3 format (linux, win32,
    and mac).
    akbarhome, May 15, 2007
    #2
    1. Advertising

  3. Stian Haklev

    Axel Etzold Guest

    Any experienced rubygems users? (was: Ruby distribution woes - bz2 liband mongrel)

    Dear all,

    I am writing to say that I am experiencing the same
    problems as Stian - I am even experiencing these problems when
    I try to run a very small test application, without
    any libraries and gems, that just asks the user for
    a string and then repeats it.
    I repeatedly posted on this list to get some clue
    why this is so, but got no response that solves my
    problems ( please help again, Erik!):

    1.) I would like to be able to start an application,
    from a binary, made by tar2rubyscript/rubyscript2exe, that will
    run on (m)any Linux - distribution(s) installed on a i386/i586
    machine (and, separately, on Windows XP), from the following script:

    p 'Please insert some text'
    f.gets
    p 'You typed in:'
    p f.chomp

    If I create the binary under Linux on one machine, this works
    fine, but when I execute it, I always get:

    /bin/sh: /tmp/eee.appl2_linux.2/bin/ruby: cannot execute binary file

    (appl2_linux is the name of my binary).


    2.) I'd like to know how to distribute gems and libraries
    with such a binary executable ( I'd need gsl, FXRuby, mostly),
    maybe all compiled statically....

    Could somebody kindly point me to a tutorial/wiki that describes
    this for the utterly confused ? Of course, I read the manuals
    for tar2rubyscript, and rubyscript2exe, but I couldn't yet find
    anything solving my difficulties in there.

    Thank you for any help.

    Best regards,

    Axel


    > Hi everyone,
    >
    > sometimes it really frustrates me that it's so difficult to distribute
    > applications written with Ruby. You hack together something quickly that
    > works perfectly on your own machine, with all the gems, libraries and
    > stuff you've installed... then you want to move it.
    >
    > In my concrete case, I'm writing an offline viewer for Wikipedia dump
    > files (it's working pretty darn well allready, with repacked files it
    > gives me 0.2 second load times from inside a packed file with over 2
    > million objects - 7z just spins for minutes). I want to put the dump
    > files and this program on a CD / DVD and give it to people, who should
    > be able to just do put in the CD, and run it straight off the CD (it's a
    > mongrel server that serves content to localhost), whether it's Windows,
    > Mac or Linux.
    >
    > I've tried with rubyscript2exe, which is a great tool, but it fails
    > currently. I think it is because I'm using two C extensions - mongrel
    > and the bz2 library. The bz2 is not even a gem, so I don't know how I'd
    > compile it for Windows. Any good ideas on best practices for
    > distributing this - ideally so that it can run as a "portable app"
    > without installation.
    >
    > Thank you so much
    > Stian
    >
    > --
    > Posted via http://www.ruby-forum.com/.


    --
    GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
    Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
    Axel Etzold, May 15, 2007
    #3
  4. Stian Haklev

    Axel Etzold Guest

    Any experienced rubyscript2exe users? (was: Ruby distribution woes -bz2 lib and mongrel)

    Dear all,

    I am writing to say that I am experiencing the same
    problems as Stian - I am even experiencing these problems when
    I try to run a very small test application, without
    any libraries and gems, that just asks the user for
    a string and then repeats it.
    I repeatedly posted on this list to get some clue
    why this is so, but got no response that solves my
    problems ( please help again, Erik!):

    1.) I would like to be able to start an application,
    from a binary, made by tar2rubyscript/rubyscript2exe, that will
    run on (m)any Linux - distribution(s) installed on a i386/i586
    machine (and, separately, on Windows XP), from the following script:

    p 'Please insert some text'
    f.gets
    p 'You typed in:'
    p f.chomp

    If I create the binary under Linux on one machine, this works
    fine, but when I execute it, I always get:

    /bin/sh: /tmp/eee.appl2_linux.2/bin/ruby: cannot execute binary file

    (appl2_linux is the name of my binary).


    2.) I'd like to know how to distribute gems and libraries
    with such a binary executable ( I'd need gsl, FXRuby, mostly),
    maybe all compiled statically....

    Could somebody kindly point me to a tutorial/wiki that describes
    this for the utterly confused ? Of course, I read the manuals
    for tar2rubyscript, and rubyscript2exe, but I couldn't yet find
    anything solving my difficulties in there.

    Thank you for any help.

    Best regards,

    Axel
    >
    >
    > > Hi everyone,
    > >
    > > sometimes it really frustrates me that it's so difficult to distribute
    > > applications written with Ruby. You hack together something quickly that
    > > works perfectly on your own machine, with all the gems, libraries and
    > > stuff you've installed... then you want to move it.
    > >
    > > In my concrete case, I'm writing an offline viewer for Wikipedia dump
    > > files (it's working pretty darn well allready, with repacked files it
    > > gives me 0.2 second load times from inside a packed file with over 2
    > > million objects - 7z just spins for minutes). I want to put the dump
    > > files and this program on a CD / DVD and give it to people, who should
    > > be able to just do put in the CD, and run it straight off the CD (it's a
    > > mongrel server that serves content to localhost), whether it's Windows,
    > > Mac or Linux.
    > >
    > > I've tried with rubyscript2exe, which is a great tool, but it fails
    > > currently. I think it is because I'm using two C extensions - mongrel
    > > and the bz2 library. The bz2 is not even a gem, so I don't know how I'd
    > > compile it for Windows. Any good ideas on best practices for
    > > distributing this - ideally so that it can run as a "portable app"
    > > without installation.
    > >
    > > Thank you so much
    > > Stian
    > >
    > > --
    > > Posted via http://www.ruby-forum.com/.

    >
    > --
    > GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
    > Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail


    --
    GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
    Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
    Axel Etzold, May 15, 2007
    #4
  5. Stian Haklev

    Stian Haklev Guest

    Akbar Home wrote:
    > On May 15, 10:54 am, Stian Haklev <> wrote:
    >> million objects - 7z just spins for minutes). I want to put the dump
    >> without installation.
    >>
    >> Thank you so much
    >> Stian
    >>
    >> --
    >> Posted viahttp://www.ruby-forum.com/.

    >
    > Webrick instead of Mongrel should make more portable.
    >
    > If you want Linux guy, Windows guy, Mac guy can access your cd, you
    > must supply ruby (and the whole shebangs) in 3 format (linux, win32,
    > and mac).


    I agree that Webrick would make it eaier, although it's quite a bit
    slower, also - as far as I know - there is no way to put a handler on /
    , and another on /search - the /search gets eaten by the /, which makes
    for ugly URLs.

    The situation with the bz2 library is more serious... I could use the
    built-in gzip lib, but the difference is really about 30%, and we're
    talking huge files here - for the English one I'll have to use a
    shoehorn to get it in to one DVD :)

    And I would be happy to spend the few megabytes needed to supply all of
    Ruby, if I could just figure out exactly how. I am also hoping that in
    all the frenzy of developing new runtimes for Ruby, people think about
    distribution, because it's horribly stumping when you develop a great
    new app, and you can't get it out to people.

    Stian

    --
    Posted via http://www.ruby-forum.com/.
    Stian Haklev, May 15, 2007
    #5
  6. Stian Haklev

    David Mullet Guest

    I don't know if this will help or not, but you can specify binaries to
    embed in your rubyscript2exe executable...

    RUBYSCRIPT2EXE.bin = ["file1", "file2"]

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

    > And I would be happy to spend the few megabytes needed to supply all of
    > Ruby, if I could just figure out exactly how.


    You might want to check out Erik Veenstra's AllInOneRuby...

    http://www.erikveen.dds.nl/allinoneruby

    David

    http://rubyonwindows.blogspot.com


    --
    Posted via http://www.ruby-forum.com/.
    David Mullet, May 15, 2007
    #6
  7. Stian Haklev

    Stian Haklev Guest

    Thank you all. I guess what I need is to sit down with a computer that
    has never had Ruby installed and figure out which files it's trying to
    access and then supply them - whether in the Ruby script or as an
    installer.

    I also need to figure out how to compile the bzip2 extension for
    Windows. I read something about using mingw on Linux that could work. I
    guess if I did it in cygwin, the binaries would be huge because they
    would contain the entire cygwin package?

    Thank you
    Stian


    --
    Posted via http://www.ruby-forum.com/.
    Stian Haklev, May 16, 2007
    #7
  8. Re: Any experienced rubyscript2exe users?

    --9UV9rz0O2dU/yYYn
    Content-Type: text/plain; charset=us-ascii
    Content-Disposition: inline
    Content-Transfer-Encoding: quoted-printable

    On 2007-05-15 17:34:45 +0900 (Tue, May), Axel Etzold wrote:
    > If I create the binary under Linux on one machine, this works
    > fine, but when I execute it, I always get:
    > =20
    > /bin/sh: /tmp/eee.appl2_linux.2/bin/ruby: cannot execute binary file=20
    > =20
    > (appl2_linux is the name of my binary).


    You may need to check whether the /tmp is not mounted with noexec
    option, or just move your binary out of /tmp. The tmp dir is usually
    terribly insecure place to store programs.

    Just guessing.

    --=20
    No virus found in this outgoing message.
    Checked by 'grep -i virus $MESSAGE'
    Trust me.

    --9UV9rz0O2dU/yYYn
    Content-Type: application/pgp-signature
    Content-Disposition: inline

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.7-ecc0.1.6 (GNU/Linux)

    iD8DBQFGS0MHsnU0scoWZKARAmAfAJ9uCv55SPCH4lnSyLy2pEuy8CuiwQCg0Xxg
    NqvlA74kgECnft4Kfu2u4bc=
    =NOt2
    -----END PGP SIGNATURE-----

    --9UV9rz0O2dU/yYYn--
    Mariusz Pękala, May 16, 2007
    #8
  9. Stian Haklev

    Axel Etzold Guest

    Dear Stian,

    I have managed to make a binary created from tar2rubyscript/rubyscript2exe
    that runs on another computer, provided that it uses the same
    live Linux distribution ... so maybe , if you're developing
    essentially for demonstrative purposes ( program sth. for an
    academic thesis etc...), you can distribute a Live Linux distribution
    alongside your application on a CD...
    I know that's not a mass-market solution yet :(
    I will try what I can do for Windows next week.

    Actually, I sometimes think the response frequency distribution to
    individual threads on this list has changed somewhat to the worse:
    say, a year or more ago, my impression is that generally,
    the average number of answers to a request used to be smaller,
    but many experienced users tried to contribute a lot of information
    per post.
    Now the number of posts has dramatically increased for some threads,
    but there many people just agreeing or disagreeing on some tangential
    aspect, whereas many threads get drowned - and unanswered - in a hundred
    responses to these big threads (sigh).

    Best regards,

    Axel



    -------- Original-Nachricht --------
    Datum: Wed, 16 May 2007 16:53:53 +0900
    Von: Stian Haklev <>
    An:
    Betreff: Re: Ruby distribution woes - bz2 lib and mongrel

    > Thank you all. I guess what I need is to sit down with a computer that
    > has never had Ruby installed and figure out which files it's trying to
    > access and then supply them - whether in the Ruby script or as an
    > installer.
    >
    > I also need to figure out how to compile the bzip2 extension for
    > Windows. I read something about using mingw on Linux that could work. I
    > guess if I did it in cygwin, the binaries would be huge because they
    > would contain the entire cygwin package?
    >
    > Thank you
    > Stian
    >
    >
    > --
    > Posted via http://www.ruby-forum.com/.


    --
    Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten
    Browser-Versionen downloaden: http://www.gmx.net/de/go/browser
    Axel Etzold, May 16, 2007
    #9
  10. Stian Haklev

    Stian Haklev Guest

    Hi Axel,

    thanks a lot for the effort. This is definitively not an academic
    effort, I really wnat as many people as possible to be able to use it.
    I'm not going to be working much on a computer for the next 10 days, but
    during that travel I'm getting a new laptop, and I'm going to try to set
    up some virtual machines or something so I can play around with getting
    it to work on a "clean installation"... It really should be possible, if
    I just knew which files to copy to where.

    Thanks a lot again, and I might be in touch later.
    Stian

    --
    Posted via http://www.ruby-forum.com/.
    Stian Haklev, May 18, 2007
    #10
    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. Magdoll
    Replies:
    3
    Views:
    369
    Steven D'Aprano
    Jun 5, 2010
  2. Zed Shaw
    Replies:
    3
    Views:
    222
    Zed Shaw
    Apr 5, 2006
  3. Zed Shaw
    Replies:
    8
    Views:
    152
    Zed Shaw
    Apr 5, 2006
  4. rabarama
    Replies:
    1
    Views:
    145
    Luis Lavena
    Dec 15, 2009
  5. Sniper Abandon
    Replies:
    2
    Views:
    114
    Ammar Ali
    Dec 6, 2010
Loading...

Share This Page