Проблемы с Rails 4 и mongoid на режиме производства


Я работаю с rails 4.2.Икс и Монгол . Я получаю следующую ошибку, когда пытаюсь запустить сервер в рабочем режиме, но он работает гладко в режиме разработки, не знаю, почему я получаю эту ошибку . Я пробовал прекомиплировать задницы, но безуспешно.

=> 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:
1 2

1 ответ:

Ошибка была вызвана из почтовых программ, где я использовал "include ActionView:: Helpers" вне класса электронной почты.

Я исправил это, сохранив include ActionView:: Helpers внутри класса, я не уверен в этом порядке включения. Я изменился следующим образом

include ActionView::Helpers    
class EmailMailer < ActionMailer::Base

К

class EmailMailer < ActionMailer::Base
  include ActionView::Helpers

Надеюсь, что это поможет для кого-то , я все еще ищу о порядке включения модулей в классы, как только я нашел необходимую информацию, я опубликую здесь .