未定义的方法`override_actionmailer_config =&#39; for#<spree :: appconfiguration:0x000000092faba8>(NoMethodError)

时间:2016-11-09 15:03:46

标签: ruby-on-rails spree rails-upgrade spree-upgrade

我目前正在将我的应用程序从rails 3.2升级到rails 4.2

我还要将Spree2.0升级为3.1我正在关注this教程

我已经解决了其他依赖项,但我仍然遇到此错误:

  

未定义的方法`override_actionmailer_config =&#39;对于#&lt;礼包:: AppConfiguration:0x000000092faba8&GT; (NoMethodError)

完整跟踪:

$ rails s

=> Booting Thin
=> Rails 4.2.7.1 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
/home/deepak/.rvm/gems/ruby-2.3.1/gems/spree_core-3.1.1/app/models/spree/preferences/configuration.rb:66:in `method_missing': undefined method `override_actionmailer_config=' for #<Spree::AppConfiguration:0x000000092faba8> (NoMethodError)
  from /home/deepak/workspace/Project/config/initializers/spree.rb:12:in `block in <top (required)>'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/spree_core-3.1.1/lib/spree/core.rb:60:in `config'
  from /home/deepak/workspace/Project/config/initializers/spree.rb:8:in `<top (required)>'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/zeus-0.15.10/lib/zeus/load_tracking.rb:76:in `load'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/zeus-0.15.10/lib/zeus/load_tracking.rb:76:in `load'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/zeus-0.15.10/lib/zeus/load_tracking.rb:68:in `load'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:268:in `block in load'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:268:in `load'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/railties-4.2.7.1/lib/rails/engine.rb:652:in `block in load_config_initializer'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.7.1/lib/active_support/notifications.rb:166:in `instrument'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/railties-4.2.7.1/lib/rails/engine.rb:651:in `load_config_initializer'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/railties-4.2.7.1/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/railties-4.2.7.1/lib/rails/engine.rb:615:in `each'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/railties-4.2.7.1/lib/rails/engine.rb:615:in `block in <class:Engine>'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/railties-4.2.7.1/lib/rails/initializable.rb:30:in `instance_exec'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/railties-4.2.7.1/lib/rails/initializable.rb:30:in `run'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/railties-4.2.7.1/lib/rails/initializable.rb:55:in `block in run_initializers'
  from /home/deepak/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
  from /home/deepak/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
  from /home/deepak/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
  from /home/deepak/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
  from /home/deepak/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/railties-4.2.7.1/lib/rails/initializable.rb:44:in `each'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/railties-4.2.7.1/lib/rails/initializable.rb:44:in `tsort_each_child'
  from /home/deepak/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:415:in `call'
  from /home/deepak/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:415:in `each_strongly_connected_component_from'
  from /home/deepak/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
  from /home/deepak/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `each'
  from /home/deepak/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `call'
  from /home/deepak/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
  from /home/deepak/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
  from /home/deepak/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/railties-4.2.7.1/lib/rails/initializable.rb:54:in `run_initializers'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/railties-4.2.7.1/lib/rails/application.rb:352:in `initialize!'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/railties-4.2.7.1/lib/rails/railtie.rb:194:in `public_send'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/railties-4.2.7.1/lib/rails/railtie.rb:194:in `method_missing'
  from /home/deepak/workspace/Project/config/environment.rb:5:in `<top (required)>'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
  from /home/deepak/workspace/Project/config.ru:12:in `block in <main>'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
  from /home/deepak/workspace/Project/config.ru:in `new'
  from /home/deepak/workspace/Project/config.ru:in `<main>'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/rack-1.6.4/lib/rack/server.rb:299:in `build_app_and_options_from_config'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/rack-1.6.4/lib/rack/server.rb:208:in `app'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/railties-4.2.7.1/lib/rails/commands/server.rb:61:in `app'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/rack-1.6.4/lib/rack/server.rb:336:in `wrapped_app'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/railties-4.2.7.1/lib/rails/commands/server.rb:139:in `log_to_stdout'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/railties-4.2.7.1/lib/rails/commands/server.rb:78:in `start'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:80:in `block in server'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:75:in `tap'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:75:in `server'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
  from /home/deepak/.rvm/gems/ruby-2.3.1/gems/railties-4.2.7.1/lib/rails/commands.rb:17:in `<top (required)>'
  from script/rails:6:in `require'
  from script/rails:6:in `<main>'

我在 config / initializers / spree.rb

中有以下内容
Spree.config do |config|
  # Example:
  # Uncomment to override the default site name.
  # config.site_name = "Spree Demo Site"
  config.override_actionmailer_config = false
  config.address_requires_state = true
  config.auto_capture = true
  config.always_include_confirm_step = true
  config.track_inventory_levels = false
  config.allow_ssl_in_staging = false
  config.allow_ssl_in_production = true
  config.mails_from = 'no-reply@something.com'
  config.default_country_id = ' '
end

感谢。

1 个答案:

答案 0 :(得分:0)

已在Spree 3.x中删除

override_actionmailer_config=

所有邮件程序配置都已提取到扩展程序https://github.com/spree-contrib/spree_mail_settings

因此添加到您的Gemfile

gem 'spree_mail_settings', github: 'spree-contrib/spree_mail_settings', branch: '3-1-stable'

根据此扩展自述文件进行配置。