尝试升级到rails 3.1获取错误:method_missing':undefined method`action_mailer

时间:2012-03-08 02:26:14

标签: ruby-on-rails ruby-on-rails-3.1

我们已经使用rails 3.0.9很长一段时间了,因为我们现在想要升级到最新版本的依赖项。我们从:

设置gem文件
gem 'rails', '3.0.9'
gem 'rake', '0.9.2.2'

要:

gem 'rails'
gem 'rake'
gem "actionmailer"

现在当我们尝试运行rails时,会出现以下错误:

/Users/xxx/.rvm/gems/ruby-1.9.2-p180@andyw/gems/railties-3.2.2/lib/rails/railtie/configuration.rb:85:in `method_missing': undefined method `action_mailer' for #<Rails::Application::Configuration:0x00000102b66c48> (NoMethodError)
    from /Users/xxx/Sites/picasso/config/environments/development.rb:18:in `block in <top (required)>'
    from /Users/xxx/.rvm/gems/ruby-1.9.2-p180@andyw/gems/railties-3.2.2/lib/rails/railtie/configurable.rb:24:in `class_eval'
    from /Users/xxx/.rvm/gems/ruby-1.9.2-p180@andyw/gems/railties-3.2.2/lib/rails/railtie/configurable.rb:24:in `configure'
    from /Users/xxx/Sites/picasso/config/environments/development.rb:1:in `<top (required)>'
    from /Users/xxx/.rvm/gems/ruby-1.9.2-p180@andyw/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:251:in `require'

想法?感谢

1 个答案:

答案 0 :(得分:1)

尽量只放

gem 'rails', '3.2.2'

在您的Gemfile中运行bundle命令。 您不必担心gemfile中的actionmailer或rake。