错误信息是:
MissingSourceFile in QuotesController#accept
no such file to load -- echo_sign
/Users/martin/.rbenv/versions/1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/Users/martin/.rbenv/versions/1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
/Users/martin/.rbenv/versions/1.8.7-p374/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require'
/Users/martin/.rbenv/versions/1.8.7-p374/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:547:in `new_constants_in'
/Users/martin/.rbenv/versions/1.8.7-p374/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require'
/Users/martin/Desktop/[project_name]/app/controllers/quotes_controller.rb:182:in `accept'
This error occurred while loading the following files:
echo_sign
在我的控制器中,我有:
require 'echo_sign'
我的项目使用的是 ruby 1.8.7,但上面的 gem 需要 1.9.3,所以我更新了项目的 ruby 版本,首先安装较新的版本,然后在本地设置并运行rbenv rehash
rbenv local : 1.9.3-p448
rbenv global : 2.0.0-p0
ruby-v : ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-darwin12.4.0]
然而,该应用程序似乎在错误的版本文件夹中查找 gem,有什么想法吗?