2016-11-09 103 views
0

我目前升級從軌道3.2我的應用程序軌道4.2未定義的方法`override_actionmailer_config =」爲#<狂歡:: AppConfiguration:0x000000092faba8>(NoMethodError)

也我升級我的Spree2.03.1我以下this教程

我已經解決了其他相關性,但我仍然得到這個錯誤:

undefined method `override_actionmailer_config=' for #< Spree::AppConfiguration:0x000000092faba8> (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>' 

,我有以下的配置/初始化/ 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 = '[email protected]' 
    config.default_country_id = ' ' 
end 

感謝。

回答

0

override_actionmailer_config=已在Spree 3.x中刪除。

所有郵件程序配置已被提取到擴展名https://github.com/spree-contrib/spree_mail_settings

因此添加到您的Gemfile

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

並據此擴展README配置。

相關問題