Ruby stones are missing when running from the Xcode script shell

I am trying to run a grunt script to compile a bunch of things, including grunt-contrib-compassfrom Xcode. Launching grunt debugworks fine outside of Xcode, but not when called as a shell script as part of the build phase in Xcode.

running grunt debugI get:

/Users/MY_USER/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/dependency.rb:298:in `to_specs': Could not find a compass (> = 0) among 14 gems (Gem :: LoadError)

By loading into my PATH variables at the top of the script with:

PATH=$(bash -l -c 'echo $PATH')

Xcode seems to load into the correct ruby ​​and gem versions:

which ruby     ->  /Users/MY_USER/.rvm/rubies/ruby-2.1.0/bin/ruby
which compass  ->  /Users/MY_USER/.rvm/gems/ruby-2.1.0/bin/compass
which gem      ->  /Users/MY_USER/.rvm/rubies/ruby-2.1.0/bin/gem

These are the same as the messages from bash.

gem query --local Xcode, bash. - , , Could not find 'compass', , , ?

gem env, script, Xcode:

RubyGems Environment:
  - RUBYGEMS VERSION: 2.2.2
  - RUBY VERSION: 2.1.0 (2013-12-25 patchlevel 0) [x86_64-darwin12.0]
  - INSTALLATION DIRECTORY: /Users/MY_USER/.rvm/rubies/ruby-2.1.0/lib/ruby/gems/2.1.0
  - RUBY EXECUTABLE: /Users/MY_USER/.rvm/rubies/ruby-2.1.0/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/MY_USER/.rvm/rubies/ruby-2.1.0/bin
  - SPEC CACHE DIRECTORY: /Users/MY_USER/.gem/specs
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-12
  - GEM PATHS:
     - /Users/MY_USER/.rvm/rubies/ruby-2.1.0/lib/ruby/gems/2.1.0
     - /Users/MY_USER/.gem/ruby/2.1.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /Users/MY_USER/.rvm/gems/ruby-2.1.0/bin
     - /Users/MY_USER/.rvm/gems/ruby-2.1.0@global/bin
     - /Users/MY_USER/.rvm/rubies/ruby-2.1.0/bin
     - /opt/local/bin
     - /opt/local/sbin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /usr/local/bin
     - /usr/local/git/bin
     - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
     - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/libexec
     - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin
     - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/local/bin
     - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/usr/bin
     - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/usr/local/bin
     - /Applications/Xcode.app/Contents/Developer/usr/bin
     - /Applications/Xcode.app/Contents/Developer/usr/local/bin
     - /Applications/Xcode.app/Contents/Developer/Tools
     - /Users/MY_USER/bin
     - /Users/MY_USER/Development/adt-bundle/sdk/platform-tools
     - /Users/MY_USER/Development/adt-bundle/sdk/tools
     - /Users/MY_USER/.rvm/bin
+3
1

, -

echo $(bash -l -c  "source ~/.bashrc && cd $myProjectLocation && grunt debug")

grunt bash, Xcode bash Xcode.

, , - bash , script, .

, - .

+2

All Articles