From: Rich W. <rw...@gm...> - 2008-02-12 10:49:22
|
Ok, I'm giving up (at least temporarily). Standaloneify just doens't seem to play well with Leopard. I edited rb_main.rb to add the RubyCocoa and all the main Ruby libraries back into the $LOAD_PATH. This let me run the application on my development machine. However, when I tried to move it to another computer, it refused to run. I spend a lot of time playing with the load paths, but kept getting odd errors, and never got it to work right. It always complained about an uninitialized constant OSX::NSString::NKF. Nothing I tried could get around this. So I had XCode copy the RubyCocoa bundle into the application--but that wouldn't even run locally (I probably have to add the Ruby libraries back into the path again...or maybe copy the Ruby framework into the app...but that's starting to get ridiculous). It doesn't really matter for this project. But, it would be nice to have some way of bundling the gems I'm using into the app itself. Any suggestions? -Rich- On Feb 4, 2008, at 2:44 AM, Eloy Duran wrote: > After you've added the copy files build phase, > you'll need to drag RubyCocoa.framework into that "copy files build > phase" too. > > However, if your app works with the default Leopard RubyCococa > and you're only targeting Leopard, then I would not bundle it > but rather fix your load path problem. > > So if you look at the rb_,main.rb file of your standaloneified bundle, > at the top you'll see some code that was added by Standaloneify. > Underneath that do something like: > $LOAD_PATH.unshift("/Library/Ruby/Site/1.8") > > Then you should probably be able to do: require 'osx/cocoa' > > Cheers, > Eloy > > On 4 feb 2008, at 10:28, Rich Warren wrote: > >> Ok, I tried to bundle the RubyCocoa framework, but Xcode won't seem >> to >> let me. >> >> I added a new copy files build phase. >> I set the destination to "Frameworks". >> I then added an existing framework, and selected RubyCocoa >> >> The "Add" button is highlighted. But pressing it doesn't seem to do >> anything. >> >> Clearly I'm doing something wrong here. How do I bundle RubyCocoa >> into >> my app? >> >> -Rich- >> >> On Feb 3, 2008, at 10:54 PM, Eloy Duran wrote: >> >>> Hi Rich, >>> >>> It's true that andy Leopard install will have RubyCocoa installed. >>> However iirc standaloneify will completely empty your load path >>> before starting the application. >>> This means that unless you've bundled the framework it won't be >>> found. >>> So my guess is that you haven't bundled the framework inside your >>> app, >>> which is ok of course, but in wich case you'll have to edit your >>> rb_main.rb >>> file after it has been standalonified to setup the correct load path >>> or maybe >>> even better; instead of doing "require 'osx/cocoa'" try to specify >>> the >>> full path. >>> >>> Cheers, >>> Eloy >>> >>> On 4 feb 2008, at 02:12, Rich Warren wrote: >>> >>>> Hi, >>>> >>>> I'm trying to embed some RubyGem libraries into a stand alone app. >>>> According to the web site, I used the following command: >>>> >>>> ruby standaloneify.rb -d RubyRSS_StandAlone.app RubyRSS.app >>>> >>>> Everything seemed fine. But when I tried to run the stand alone >>>> app, >>>> It fails to launch. I get the following message in the console: >>>> >>>> 2/3/08 3:03:57 PM >>>> [0x0 >>>> -0x31031].com.apple.rubycocoa.NEWCOREDATAPROJECT.RubyRSSApp[278] / >>>> Users/rikiwarren/Desktop/RubyRSS_StandAlone.app/Contents/Resources/ >>>> rb_main.rb:25:in `require': no such file to load -- osx/cocoa >>>> (LoadError) >>>> >>>> 2/3/08 3:03:57 PM >>>> [0x0 >>>> -0x31031].com.apple.rubycocoa.NEWCOREDATAPROJECT.RubyRSSApp[278] >>>> from /Users/rikiwarren/Desktop/RubyRSS_StandAlone.app/Contents/ >>>> Resources/rb_main.rb:25 >>>> >>>> 2/3/08 3:03:57 PM com.apple.launchd[63] >>>> ([0x0 >>>> -0x31031].com.apple.rubycocoa.NEWCOREDATAPROJECT.RubyRSSApp[278]) >>>> Exited with exit code: 1 >>>> >>>> If I'm reading this right, it's having trouble finding the osx/ >>>> cocoa >>>> library. However, since I'm working on Leopard, all Leopard >>>> machines >>>> should have osx/cocoa installed by default, right? >>>> >>>> Am I doing something wrong? How do I get standaloneify to work on >>>> Leopard? >>>> >>>> Thanks, >>>> >>>> -Rich- >>>> >>>> ------------------------------------------------------------------------- >>>> This SF.net email is sponsored by: Microsoft >>>> Defy all challenges. Microsoft(R) Visual Studio 2008. >>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >>>> _______________________________________________ >>>> Rubycocoa-talk mailing list >>>> Rub...@li... >>>> https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk >>> >>> >>> ------------------------------------------------------------------------- >>> This SF.net email is sponsored by: Microsoft >>> Defy all challenges. Microsoft(R) Visual Studio 2008. >>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >>> _______________________________________________ >>> Rubycocoa-talk mailing list >>> Rub...@li... >>> https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk >> >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Microsoft >> Defy all challenges. Microsoft(R) Visual Studio 2008. >> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >> _______________________________________________ >> Rubycocoa-talk mailing list >> Rub...@li... >> https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk |