Need help with miniruby

Discussion in 'Ruby' started by Mike Wilson, Dec 29, 2003.

  1. Mike Wilson

    Mike Wilson Guest

    I'm trying to put an app together that I would need to run on quite a few
    like systems, and I'd like to not have to install ruby on each one.
    Currently, I'm trying to use miniruby to accomplish this. Is this an ok way
    to go?

    So, far I have a directory structure that looks like this:

    /usr/local/myapp
    /usr/local/myapp/runmyapp <- #!bin/miniruby ...
    $LOAD_PATH << "lib"
    /usr/local/myapp/bin/miniruby
    /usr/local/myapp/lib/*.rb
    /usr/local/myapp/lib/digest.so
    /usr/local/myapp/lib/digest/md5.so

    Which mostly works, except I need access to the md5 stuff and I seem to have
    problems using it after copying the digest.so and md5.so into my lib
    directory. Rather than printing an md5 hash when I do something like
    digest.to_s, it prints the Object reference (#<MD5:0xe77b8>). Also, I have
    to explicitly require "digest". I assume that I have some issue with
    autoloading, but I'm not sure. Can anyone tell me how to fix this?

    What's the best way to do this, or does everyone just install all of ruby?

    _________________________________________________________________
    Check your PC for viruses with the FREE McAfee online computer scan.
    http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
    Mike Wilson, Dec 29, 2003
    #1
    1. Advertising

  2. Mike Wilson

    Gennady Guest

    Mike Wilson wrote:
    > I'm trying to put an app together that I would need to run on quite a
    > few like systems, and I'd like to not have to install ruby on each one.
    > Currently, I'm trying to use miniruby to accomplish this. Is this an ok
    > way to go?
    >
    > So, far I have a directory structure that looks like this:
    >
    > /usr/local/myapp
    > /usr/local/myapp/runmyapp <- #!bin/miniruby ...
    > $LOAD_PATH << "lib"
    > /usr/local/myapp/bin/miniruby
    > /usr/local/myapp/lib/*.rb
    > /usr/local/myapp/lib/digest.so
    > /usr/local/myapp/lib/digest/md5.so
    >
    > Which mostly works, except I need access to the md5 stuff and I seem to
    > have problems using it after copying the digest.so and md5.so into my
    > lib directory. Rather than printing an md5 hash when I do something
    > like digest.to_s, it prints the Object reference (#<MD5:0xe77b8>).
    > Also, I have to explicitly require "digest". I assume that I have some
    > issue with autoloading, but I'm not sure. Can anyone tell me how to fix
    > this?
    >
    > What's the best way to do this, or does everyone just install all of ruby?
    >
    > _________________________________________________________________
    > Check your PC for viruses with the FREE McAfee online computer scan.
    > http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
    >
    >


    Actually, you can use ruby exactly same way as you use miniruby now. I
    also ship ruby executable together with my application plus all standard
    ruby library files required by the application (I put them in my own
    directories and adjust $LOAD_PATH as you do). Just to note, ruby
    executable does not need any of the standard ruby library files to
    function properly (unless your application explicitly require them).

    I am not sure what's the problem with digest.so and md5.so in
    "miniruby", however with just "ruby" everything works great.

    Gennady.
    Gennady, Dec 29, 2003
    #2
    1. Advertising

  3. Mike Wilson

    Laza Guest

    Why don't you use rubyscript2exe? It creates an executable which tars/zips
    rub interpreter plus all ruby files/libs used by your script.

    -Laza
    http://lazax.com/blog

    On Tue, 30 Dec 2003 06:16:03 +0900, Gennady <> wrote:

    > Mike Wilson wrote:
    >> I'm trying to put an app together that I would need to run on quite a
    >> few like systems, and I'd like to not have to install ruby on each
    >> one. Currently, I'm trying to use miniruby to accomplish this. Is
    >> this an ok way to go?
    Laza, Mar 1, 2004
    #3
    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. Phil Tomson
    Replies:
    11
    Views:
    282
    Dick Davies
    May 8, 2004
  2. Edwin Eyan Moragas

    miniruby capabilities Q

    Edwin Eyan Moragas, Aug 25, 2004, in forum: Ruby
    Replies:
    2
    Views:
    136
    Edwin Eyan Moragas
    Aug 26, 2004
  3. Markus Kolb
    Replies:
    1
    Views:
    106
    Markus Kolb
    Nov 1, 2006
  4. Bill
    Replies:
    2
    Views:
    147
    Michal Suchanek
    May 15, 2007
  5. Yusuf Celik
    Replies:
    1
    Views:
    125
    Rick DeNatale
    Jul 20, 2007
Loading...

Share This Page