我遇到了一个问题,我构建了一个脚本来通过 Boxcar 发送通知。该脚本已#!/usr/bin/env ruby
设置在顶部,但是当 SABnzb 触发后处理脚本时,它会出现以下错误:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- boxcar_api (LoadError) from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require' from /Applications/Sick-Beard/autoProcessTV/sabnzb-notification.rb:4
此外,当我从终端运行脚本时,它执行得很好。只有当 SABnzb 在后处理中执行它时。
如果我运行which ruby
,它们都会输出正确版本ruby -v
的/usr/bin/env ruby -v
Ruby。
$ which ruby
/Users/ericc/.rvm/rubies/ruby-1.9.3-p286/bin/ruby
$ ruby -v
ruby 1.9.3p286 (2012-10-12 revision 37165) [x86_64-darwin12.2.0]
$ /usr/bin/env ruby -v
ruby 1.9.3p286 (2012-10-12 revision 37165) [x86_64-darwin12.2.0]
$ rvm -v
rvm 1.16.13 (master) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
~/.bash_profile
export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH"
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
任何人都知道为什么要加载 Ruby 1.8 而不是 RVM?