rubycocoa embedded ruby interpreter.

Discussion in 'Ruby' started by Ezra Zygmuntowicz, Jan 25, 2006.

  1. rubies-


    I have asked before but it got lost in the shuffle. I am working on
    a bunch of rubycocoa apps for the newspaper I work for. And it is
    time to deploy them on other machines. I would really like to be able
    to embed the ruby interpreter binary and the libs I need inside of
    the OSX .app executable. Does anyone out there know how this could be
    done? Or maybe have already done so? SHould I be looking at
    rubyscript2exe's osx support to see how that works?

    I would really appreciate any direction on this as I am at a loss
    and really need this functionality.

    Thanks ever so much

    -Ezra
     
    Ezra Zygmuntowicz, Jan 25, 2006
    #1
    1. Advertising

  2. I "spiked" on this a while back. You have several options, especially
    once you fire up Xcode.

    Rubyscript2exe worked well the first time I tried it. I even threw
    Rails + FXRuby at it. I followed the documentation and I had Windows
    and OS X executables, as advertised. It even handled project-relative
    file paths just fine.

    Now, if I recall correctly, rubyscript2exe expands its contents into
    a temp directory. That took a noticeable amount of time with my app.
    I think it may need to repeat the expansion every time you launch the
    app, but I could be wrong.

    More recently, I tried rubyscript2exe again on the same app: more
    code, but nothing else different. I kept running into "too many open
    files." As far as I can tell, there is no fix or workaround on OS X.
    The culprit is some rubyscript2exe file manipulation code. It does
    look possible to debug and perhaps fix this code.

    "Programming Ruby" (the pickaxe) chapter 21 is a good guide for
    embedding Ruby. After some determined fiddling with Xcode, I was able
    to write a simple nicely-packaged Cocoa app that called Ruby code.
    Unfortunately, in my naive approach, Rails didn't load its required
    files. I'm pretty sure that with a better understanding of Objective-
    C, Xcode, and embedded Ruby, this approach should work just fine.

    In the end, the FXRuby part of my app always runs on dev machines, so
    I made a .term file that kicks off a bash script. That's really all I
    need, though it bugs me that I don't have a nice icon on in the dock.

    You may have an easier time of it with RubyCocoa, but then again, I
    wonder if RubyCocoa embedded in a real Cocoa app might be like
    putting two Siamese Fighting Fish in the same tank?

    Hope that is of some help,
    Scott


    On Jan 24, 2006, at 4:00 PM, Ezra Zygmuntowicz wrote:

    > rubies-
    >
    >
    > I have asked before but it got lost in the shuffle. I am working
    > on a bunch of rubycocoa apps for the newspaper I work for. And it
    > is time to deploy them on other machines. I would really like to be
    > able to embed the ruby interpreter binary and the libs I need
    > inside of the OSX .app executable. Does anyone out there know how
    > this could be done? Or maybe have already done so? SHould I be
    > looking at rubyscript2exe's osx support to see how that works?
    >
    > I would really appreciate any direction on this as I am at a loss
    > and really need this functionality.
    >
    > Thanks ever so much
    >
    > -Ezra
     
    Scott Willson, Jan 25, 2006
    #2
    1. Advertising

  3. On Jan 27, 2006, at 8:19 AM, Jonathan Paisley wrote:

    > On Wed, 25 Jan 2006 09:00:50 +0900, Ezra Zygmuntowicz wrote:
    >
    >> I have asked before but it got lost in the shuffle. I am working on
    >> a bunch of rubycocoa apps for the newspaper I work for. And it is
    >> time to
    >> deploy them on other machines. I would really like to be able to
    >> embed the
    >> ruby interpreter binary and the libs I need inside of the OSX .app
    >> executable. Does anyone out there know how this could be done? Or
    >> maybe
    >> have already done so? SHould I be looking at rubyscript2exe's osx
    >> support
    >> to see how that works?
    >>
    >> I would really appreciate any direction on this as I am at a loss
    >> and really need this functionality.

    >
    > Please take a look at my little script which does this:
    >
    > http://www.dcs.gla.ac.uk/~jp/standaloneify.rb
    >
    > Also, try the rubycocoa mailing list for related questions.
    >
    > Cheers,
    > Jonathan
    >
    >


    Jonathan-

    Great thank you very much. i wasn't aware of a rubycocoa mailing
    list but I will sign up right away. A really appreciate you answering
    my question.

    Thanks so much-

    Ezra
     
    Ezra Zygmuntowicz, Jan 27, 2006
    #3
  4. Ezra Zygmuntowicz

    Une bévue Guest

    Jonathan Paisley <> wrote:

    > Please take a look at my little script which does this:
    >
    > http://www.dcs.gla.ac.uk/~jp/standaloneify.rb


    Fine, this isn't exactly my case, because my app isn't a cocoa one (no
    ui but bundled with a plist).

    For the time being i'm including, within my app, nearly all of the ruby
    1.8.4 hierarchy, i've build in my HOME, a special ruby hierarchy to be
    embeded.

    basically my requires are :

    require 'osx/aeosa'
    require 'xml/xslt'
    require "iconv"
    require 'rexml/document'
    include REXML

    Do you think your script "standaloneify.rb" could be of any help ?

    Apart ruby in HOME, i'm using a 1.8.4 ruby within the prefix :
    /usr/local

    with your script, do you i can embed the latest in my app ?

    Here is the directory structure of my app :

    /path/to/AB2Web.app/
    Contents/
    Info.plist
    PkgInfo
    Resources/
    AB2Web.icns
    MacOS/
    AS/ // applescripts folder
    bin/ // ruby bin folder
    html/ // aux. files
    lib/ // ruby lib folder
    rb/ // ruby scripts folder
    run // app launcher (zsh script)
    xml/ // aux. files


    --
    une bévue
     
    Une bévue, Jan 28, 2006
    #4
    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. Replies:
    3
    Views:
    788
    Ziga Seilnacht
    Jan 3, 2007
  2. Ivan Muzzolini
    Replies:
    1
    Views:
    129
    Gerald Murray
    Jan 4, 2006
  3. Matt Mower
    Replies:
    0
    Views:
    135
    Matt Mower
    Jan 25, 2006
  4. Lothar Scholz
    Replies:
    2
    Views:
    162
    Lothar Scholz
    Mar 12, 2007
  5. Mohit Sindhwani
    Replies:
    7
    Views:
    113
    Arlen Cuss
    Apr 27, 2008
Loading...

Share This Page