Gem::LoadError - 您已经激活了 activesupport 3.0.3,但是您的 Gemfile 需要 activesupport 3.0.0

/usr/lib/ruby/gems/1.8/gems/bundler-1.0.2/lib/bundler/runtime.rb:27:in `setup': You have already activated activesupport 3.0.3, but your Gemfile requires activesupport 3.0.0. Consider using bundle exec. (Gem::LoadError)
   from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.2/lib/bundler/spec_set.rb:12:in `each'
   from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.2/lib/bundler/spec_set.rb:12:in `each'
   from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.2/lib/bundler/runtime.rb:17:in `setup'
   from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.2/lib/bundler.rb:100:in `setup'
   from /home/maiordes/rails_apps/maiordesconto/config/boot.rb:8
   from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
   from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
   from /home/maiordes/rails_apps/maiordesconto/config/application.rb:1
   from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
   from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
   from /home/maiordes/rails_apps/maiordesconto/config/environment.rb:2
   from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
   from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
   from /home/maiordes/rails_apps/maiordesconto/daemons/ticket_handler.rb:6

最佳答案

就像错误所说的那样,您是否考虑过使用 bundle exec ? :)

通过 bundle exec 运行命令以确保可用的 Gems 版本与 Gemfile 所说的完全相同。

例如:bundle exec rails ...bundle exec rake ...

关于ruby-on-rails - 如何修复 "but your Gemfile requires activesupport 3.0.0"以下的错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/4701820/

10-13 09:44