[MacRuby] #281: Bundles pointing to local MacRuby installation instead of embedded
#281: Bundles pointing to local MacRuby installation instead of embedded -------------------------------+-------------------------------------------- Reporter: reborg@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: embedded,deploy,installation,distribution -------------------------------+-------------------------------------------- After embedding the MacRuby framework with 'macrake deploy' is not possible to distribute the application to computers without MacRuby installed if the application uses native bundles. Try this: - hotcocoa test; cd test - macrake deploy - otool -L Test.app/Contents/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1 /universal-darwin9.5/stringio.bundle The last command gives an absolute reference to libmacruby.dylib: Test.app/Contents/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1 /universal-darwin9.5/stringio.bundle: /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/libmacruby.dylib (compatibility version 0.4.0, current version 0.4.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.3) Another test: - open lib/application.rb and require 'stringio' at the top - save and close, macrake clean; macrake deploy - move the MacRuby installation dir in /Library/Frameworks to another name - run the app This is the output from the console: 6/7/09 5:08:47 PM [0x0-0xdb8db8].com.yourcompany.Test[54737] /Users/reborg/tmp/test/Test.app/Contents/Resources/lib/application.rb:1:in `require': dlopen(/Users/reborg/tmp/test/Test.app/Contents/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1 /universal-darwin9.5/stringio.bundle, 9): Library not loaded: /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/libmacruby.dylib (LoadError) 6/7/09 5:08:47 PM [0x0-0xdb8db8].com.yourcompany.Test[54737] Referenced from: /Users/reborg/tmp/test/Test.app/Contents/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1 /universal-darwin9.5/stringio.bundle 6/7/09 5:08:47 PM [0x0-0xdb8db8].com.yourcompany.Test[54737] Reason: image not found - /Users/reborg/tmp/test/Test.app/Contents/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1 /universal-darwin9.5/stringio.bundle 6/7/09 5:08:47 PM [0x0-0xdb8db8].com.yourcompany.Test[54737] from /Users/reborg/tmp/test/Test.app/Contents/Resources/lib/application.rb:1:in `<top (required)>' 6/7/09 5:08:47 PM [0x0-0xdb8db8].com.yourcompany.Test[54737] from /Users/reborg/tmp/test/Test.app/Contents/Resources/rb_main.rb:3:in `load' -- Ticket URL: <http://www.macruby.org/trac/ticket/281> MacRuby <http://macruby.org/>
#281: Bundles pointing to local MacRuby installation instead of embedded -------------------------------+-------------------------------------------- Reporter: reborg@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: embedded,deploy,installation,distribution -------------------------------+-------------------------------------------- Comment(by lsansonetti@…): As a work-around, the install_name_tool(1) tool can be run on every .bundle, to change the absolute path into a relative path to the executable. -- Ticket URL: <http://www.macruby.org/trac/ticket/281#comment:1> MacRuby <http://macruby.org/>
#281: Bundles pointing to local MacRuby installation instead of embedded -------------------------------+-------------------------------------------- Reporter: reborg@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: embedded,deploy,installation,distribution -------------------------------+-------------------------------------------- Comment(by reborg@…): Thanks Laurent for the hint, I got it working with: {{{ cd <YourApp.app>/Contents install_name_tool -change /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/libmacruby.dylib @executable_path/../Frameworks/MacRuby.framework/Versions/0.4/usr/lib/libmacruby.dylib Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/universal- darwin9.5/<BundleName>.bundle }}} where BundleName in my case were socket, fcntl, stringio, syck. I'm going to rake this on all .bundle(s) as part of the deploy build along with a clean-up of unnecessary MacRuby files (for distribution). Renzo -- Ticket URL: <http://www.macruby.org/trac/ticket/281#comment:2> MacRuby <http://macruby.org/>
#281: Bundles pointing to local MacRuby installation instead of embedded -------------------------------------------------------+-------------------- Reporter: reborg@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: major | Milestone: MacRuby 0.6 Component: MacRuby | Resolution: fixed Keywords: embedded,deploy,installation,distribution | -------------------------------------------------------+-------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.6 Comment: I believe this problem has been fixed as of 0.5. Recently in trunk, we also fixed the install name of .rbo files in r3434. So, I'm closing this ticket, please let me know if it's still a problem for you and I will re- investigate. -- Ticket URL: <http://www.macruby.org/trac/ticket/281#comment:3> MacRuby <http://macruby.org/>
#281: Bundles pointing to local MacRuby installation instead of embedded -------------------------------------------------------+-------------------- Reporter: reborg@… | Owner: lsansonetti@… Type: defect | Status: reopened Priority: major | Milestone: MacRuby 0.6 Component: MacRuby | Resolution: Keywords: embedded,deploy,installation,distribution | -------------------------------------------------------+-------------------- Changes (by miskomartinka@…): * status: closed => reopened * resolution: fixed => Comment: Hello guys, great work here with macruby/hotcocoa, thank you! I am still experiencing this issue. I installed MacRuby 0.6 on my Snow Leopard. Then installed hotcocoa with: sudo macgem install hotcocoa. Installed version of hotcocoa is 0.5.1. Then I did: hotcocoa test ls test macrake this works fine then I did macrake deploy took a while and big app package is build. when I run it it works ok. But if I run it on computer which doesn't have MacRuby installed it crashes. Also happens when I delete/move /Library/Frameworks/MacRuby.framework on my mac I got this error in console: 30/7/10 9:01:33 PM [0x0-0xf10f1].com.yourcompany.Test[4050] /Users/michal/Code/test/Test.app/Contents/Resources/lib/application.rb:1:in `<main>': dlopen(/Users/michal/Code/test/Test.app/Contents/Frameworks/MacRuby.framework/Versions/0.6/usr/lib/ruby/1.9.0/rubygems.rbo, 9): Library not loaded: /Library/Frameworks/MacRuby.framework/Versions/0.6/usr/lib/libmacruby.dylib 30/7/10 9:01:33 PM [0x0-0xf10f1].com.yourcompany.Test[4050] Reason: image not found - /Users/michal/Code/test/Test.app/Contents/Frameworks/MacRuby.framework/Versions/0.6/usr/lib/ruby/1.9.0/rubygems.rbo (LoadError) I also tried to do install_name_tool solution suggested above but it didn't help. Btw. if I create macruby app in xcode(not using cocoa) it works and build it with Embed target it works OK(also with options like --no-stdlib, --compile) -- Ticket URL: <http://www.macruby.org/trac/ticket/281#comment:4> MacRuby <http://macruby.org/>
#281: Bundles pointing to local MacRuby installation instead of embedded -------------------------------------------------------+-------------------- Reporter: reborg@… | Owner: lsansonetti@… Type: defect | Status: reopened Priority: major | Milestone: MacRuby 0.6 Component: MacRuby | Resolution: Keywords: embedded,deploy,installation,distribution | -------------------------------------------------------+-------------------- Comment(by miskomartinka@…): Based on error in console I thought that rubygems.rbo is trying to load libmacruby.dylib not from app package but from installed framework(which is not installed) so I tried to changed rubygems.rbo with this command install_name_tool -change /Library/Frameworks/MacRuby.framework/Versions/0.6/usr/lib/libmacruby.dylib /Users/michal/Code/test/Test.app/MacOS/../Frameworks/MacRuby.framework/Versions/0.6/usr/lib/libmacruby.dylib Frameworks/MacRuby.framework/Versions/0.6/usr/lib/ruby/1.9.0/rubygems.rbo but it didn't help. I now get different error which you can see in attached file testerror.crash -- Ticket URL: <http://www.macruby.org/trac/ticket/281#comment:6> MacRuby <http://macruby.org/>
#281: Bundles pointing to local MacRuby installation instead of embedded -------------------------------------------------------+-------------------- Reporter: reborg@… | Owner: lsansonetti@… Type: defect | Status: reopened Priority: major | Milestone: MacRuby 0.6 Component: MacRuby | Resolution: Keywords: embedded,deploy,installation,distribution | -------------------------------------------------------+-------------------- Comment(by miskomartinka@…): Sorry, typo above. this is command I ran to modify rubygems.rbo install_name_tool -change /Library/Frameworks/MacRuby.framework/Versions/0.6/usr/lib/libmacruby.dylib @executable_path/../Frameworks/MacRuby.framework/Versions/0.6/usr/lib/libmacruby.dylib Frameworks/MacRuby.framework/Versions/0.6/usr/lib/ruby/1.9.0/rubygems.rbo of course before I did cd Test.app/Contents -- Ticket URL: <http://www.macruby.org/trac/ticket/281#comment:7> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby