我有一个小红宝石cronjob,开头是:
#!/usr/bin/ruby
#Encoding: UTF-8
require 'pp'
require 'curb-fu'
当我在命令行中运行它时它可以正常工作。但作为一个cronjob我得到这个错误信息:
/Users/juuro/cronjobs/ratings-imdb-to-trakt.rb:5:in `require': no such file to load -- curb-fu (LoadError)
from /Users/juuro/cronjobs/ratings-imdb-to-trakt.rb:5
使用gem query --local
我检查了curb-fu和curb是否正确安装 - 它们是。
这将是gem env
:
juuroair:cronjobs juuro$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.23
- RUBY VERSION: 1.9.3 (2011-10-30 patchlevel 0) [x86_64-darwin11.3.0]
- INSTALLATION DIRECTORY: /Users/juuro/.rvm/gems/ruby-1.9.2-p290
- RUBY EXECUTABLE: /usr/local/Cellar/ruby/1.9.3-p0/bin/ruby
- EXECUTABLE DIRECTORY: /Users/juuro/.rvm/gems/ruby-1.9.2-p290/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-11
- GEM PATHS:
- /Users/juuro/.rvm/gems/ruby-1.9.2-p290
- /Users/juuro/.rvm/gems/ruby-1.9.2-p290@global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
我发现/Users/juuro/.rvm/gems/ruby-1.9.2-p290/bin
中没有这些宝石的二进制文件。但相应的ruby文件位于/Users/juuro/.rvm/gems/ruby-1.9.2-p290/gems
那里有什么问题?