我有一个用Ruby编写的cgi脚本,它是从php脚本调用的。当调用cgi脚本时,我遇到错误加载机械化:
require 'mechanize'
错误是:
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- mechanize (LoadError)
<internal:lib/rubygems/custom_require>:29:in `require'
安装了gem,我可以从irb加载它。我不确定如何对此进行故障排除。如果它有帮助,这是我的gem env输出:
RubyGems Environment:
- RUBYGEMS VERSION: 1.5.0
- RUBY VERSION: 1.9.2 (2010-08-18 patchlevel 0) [i386-linux]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.9
- RUBY EXECUTABLE: /usr/bin/ruby1.9
- EXECUTABLE DIRECTORY: /usr/local/lib/ruby/gems/1.9/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /usr/local/lib/ruby/gems/1.9
- /home/<username>/.gem/ruby/1.9
- /usr/lib/ruby/gems/1.9
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
感谢任何建议。