How to make xcode use the correct version of ruby when running a script?
问题 In xcode I have a 'run script' build phase that runs a ruby script. However, it seems that xcode is trying to run it using the default mac 1.8 version of ruby rather than the latest version. Given that the script requires a gem, it's failing with a require error and the path in the error points to /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/ Obviously the 1.8 in that path is making me suspicious. If I open up terminal and run the command ruby -v then it