我正在使用rails 4.2.x和Mongoid。当我尝试在生产模式下运行服务器时,我收到以下错误,但它在开发模式下运行顺利,不知道为什么我收到此错误。我试过预备驴但没有运气。
=> Booting Thin
=> Rails 4.2.1 application starting in production on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
/home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/actionview-4.2.1/lib/action_view/helpers/debug_helper.rb:25:in `debug': wrong number of arguments (0 for 1) (ArgumentError)
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/sprockets-rails-2.2.4/lib/sprockets/railtie.rb:131:in `block (2 levels) in <class:Railtie>'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:28:in `block in on_load'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:27:in `each'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:27:in `on_load'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/sprockets-rails-2.2.4/lib/sprockets/railtie.rb:127:in `block in <class:Railtie>'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:36:in `call'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:44:in `each'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/railties-4.2.1/lib/rails/application/finisher.rb:62:in `block in <module:Finisher>'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `instance_exec'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `run'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/railties-4.2.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/ratnakar/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
from /home/ratnakar/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /home/ratnakar/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
from /home/ratnakar/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /home/ratnakar/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:345:in `each'
from /home/ratnakar/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:345:in `call'
from /home/ratnakar/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
from /home/ratnakar/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
from /home/ratnakar/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/railties-4.2.1/lib/rails/initializable.rb:54:in `run_initializers'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/railties-4.2.1/lib/rails/application.rb:352:in `initialize!'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/railties-4.2.1/lib/rails/railtie.rb:194:in `public_send'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/railties-4.2.1/lib/rails/railtie.rb:194:in `method_missing'
from /home/ratnakar/Projects/glimpse/Mar/23/glimpse/config/environment.rb:6:in `<top (required)>'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/backports-3.6.4/lib/backports/std_lib.rb:9:in `require'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/backports-3.6.4/lib/backports/std_lib.rb:9:in `require_with_backports'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `block in require'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
from /home/ratnakar/Projects/glimpse/Mar/23/glimpse/config.ru:3:in `block in <main>'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/rack-1.6.0/lib/rack/builder.rb:55:in `instance_eval'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/rack-1.6.0/lib/rack/builder.rb:55:in `initialize'
from /home/ratnakar/Projects/glimpse/Mar/23/glimpse/config.ru:in `new'
from /home/ratnakar/Projects/glimpse/Mar/23/glimpse/config.ru:in `<main>'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/rack-1.6.0/lib/rack/builder.rb:49:in `eval'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/rack-1.6.0/lib/rack/builder.rb:49:in `new_from_string'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/rack-1.6.0/lib/rack/builder.rb:40:in `parse_file'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/rack-1.6.0/lib/rack/server.rb:299:in `build_app_and_options_from_config'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/rack-1.6.0/lib/rack/server.rb:208:in `app'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/railties-4.2.1/lib/rails/commands/server.rb:61:in `app'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/rack-1.6.0/lib/rack/server.rb:336:in `wrapped_app'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/rack-1.6.0/lib/rack/server.rb:272:in `start'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/railties-4.2.1/lib/rails/commands/server.rb:80:in `start'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `server'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/ratnakar/.rvm/gems/ruby-2.1.5@glimpse/gems/railties-4.2.1/lib/rails/commands.rb:
答案 0 :(得分:1)
错误已经从我使用过的邮件中提升了#34;包括ActionView :: Helpers&#34;在电子邮件课外面。
我通过在类中保留包含ActionView :: Helpers来修复它,我不确定这个包含顺序。我改变了如下
include ActionView::Helpers
class EmailMailer < ActionMailer::Base
到
class EmailMailer < ActionMailer::Base
include ActionView::Helpers
希望它对某人有帮助,我仍在搜索在课程中包含模块的顺序,一旦我找到了我将在此处发布的所需信息。