【发布时间】:2014-02-12 21:09:17
【问题描述】:
我正在尝试运行一个 grunt 脚本来编译一堆东西,包括来自 Xcode 的grunt-contrib-compass。在 Xcode 外部运行 grunt debug 可以正常工作,但在 Xcode 中作为构建阶段的一部分作为 shell 脚本调用时就不行了。
运行grunt debug 我收到:
/Users/MY_USER/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/dependency.rb:298:in `to_specs': 在总共 14 个 gem(s) 中找不到 'compass' (>= 0) (Gem::LoadError)
在脚本顶部加载了我的 PATH 变量:
PATH=$(bash -l -c 'echo $PATH')
Xcode 似乎正在加载正确版本的 ruby 和 gem:
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
这些与从 bash 报告的相同。
但是,gem query --local 在 Xcode 中执行时与从 bash 中运行时返回的列表不同。此列表不包含指南针 - 我想这可能是我收到 Could not find 'compass' 错误的原因,知道我能做些什么来解决这个问题吗?
这是我的 gem 环境,由 Xcode 执行的 shell 脚本报告:
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
【问题讨论】:
-
您是否考虑过添加
Gemfile并运行bundle exec grunt debug? -
你的意思是我可以通过
budle exec..运行grunt cli吗?
标签: ruby xcode gruntjs compass-sass