0
votes

I'm preparing my app for Yosemite which has removed Ruby 1.87 which my app relies on. I have copied the Ruby.framework from a Mountain Lion instance and put it into my app and added it into Copy Files.

I then ran:

install_name_tool -id @executable_path/../Frameworks/Ruby.framework/Ruby Ruby.framework/Ruby

which successfully changed the embedded framework to look at the correct Ruby. This all worked fine with the C extensions I was using.

But I'm also calling ruby with an NSTask and I use the full path to xxxx/Ruby.framework/Versions/1.8/usr/bin/ruby within my private framework - however when I try

otool -L xxxx/Ruby.framework/Versions/1.8/usr/bin/ruby

it still shows:

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/libruby.1.dylib

How do I go about changing this - I've seen the -change argument for install_name_tool and I think this is what I need but nothing seems to change the otool output.

1

1 Answers

0
votes

I was doing this slightly wrong and this article really helped:

http://thecourtsofchaos.com/2013/09/16/how-to-copy-and-relink-binaries-on-osx/

This was the format of the command that I needed to use:

$ install_name_tool -change /usr/local/Cellar/graphviz/2.32.0/lib/libgvc.6.dylib @executable_path/libgvc.6.dylib dot

In my case the libgvc.6.dylib was libruby.1.dylib and the 'dot' was 'ruby' I just needed to ensure my relative paths were correct and I was good to go. (Unfortunately using Ruby as a private framework didn't work out so I had to bite the bullet and upgrade my code for Ruby 2 - so it was all a waste of time anyway!)