From: Duncan M. <du...@on...> - 2009-08-05 18:55:29
|
As this has come up, I thought I'd report on my progress distributing the latest version of RubyCocoa inside my app bundle. The app is plain ObjC, but shells out to a command-line RubyCocoa script. Inside the bundle, my scripts are in Contents/SharedSupport I copy into Contents/SharedSupport Library/Frameworks/RubyCocoa.framework Library/Ruby/Site/1.8/osx/* Library/Ruby/Site/1.8/univeral-darwin9.0/rubycocoa.bundle as installed by the RubyCocoa 1.0 installer into /Library Now to run a script with the embedded version of RubyCocoa I have the following my_dir = File.dirname(__FILE__) lib_dir = File.basename(my_dir) == 'SharedSupport' ? my_dir : my_dir + "/../../lib/dist" # when testing local_load_path = [ File.expand_path(my_dir), File.expand_path(lib_dir + '/Library/Ruby/Site/1.8'), File.expand_path(lib_dir + '/Library/Ruby/Site/1.8'), File.expand_path(lib_dir + '/Library/Ruby/Site/1.8/powerpc- darwin9.0'), File.expand_path(lib_dir + '/Library/Ruby/Site/1.8/universal- darwin9.0')] ENV['DYLD_FALLBACK_FRAMEWORK_PATH'] = File.expand_path(lib_dir + '/ Library/Frameworks/') quoted_argv = ARGV.collect {|each| %["#{each}"]} exec %[ruby -I "#{local_load_path.join(':')}" #{File.expand_path(my_dir + '/velocraptor2.rb')} #{quoted_argv.join(' ')}] where velocraptor2.rb is the script that actually does the work. It turns out that a script can't see the effects of changing its own DYLD_FALLBACK_FRAMEWORK_PATH, hence the need to exec rather than call. Hope this helps, but if not at least I might find it again here when I need it ;-) Duncan McGregor www.velOCRaptor.com Simple Affordable Mac OCR On 5 Aug 2009, at 14:23, Eloy Duran wrote: > After installing they are yes. So you just need to remember to clean > before compiling every time. > > Eloy > > On Aug 5, 2009, at 3:16 PM, Dr Nic Williams wrote: > >> Do I need multiple copies of the rubycocoa source or are the >> compiled bits stored off within each ruby impl's directory structure? >> >> Cheers >> Nic >> >> Mocra - http://mocra.com >> Blog - http://drnicwilliams.com >> >> On 05/08/2009, at 7:47 AM, Eloy Duran <elo...@gm...> >> wrote: >> >>> Hey Nic, >>> >>> You should be able to run the install.rb script with the specific >>> binary you want to use and it should install fine afaik. Eg: >>> $ ~/.ruby_versions/1.8.7/ruby install.rb config >>> $ ~/.ruby_versions/1.8.7/ruby install.rb setup >>> $ ~/.ruby_versions/1.8.7/ruby install.rb install >>> |