“routes.rb:56:in block in <top(required)=”“>':uninitialized constant LetterOpenerWeb(NameError)”

时间:2016-09-12 11:23:27

标签: ruby-on-rails server

所以我尝试安装一些没有成功的宝石,当我试图运行“rails server”时,我收到一条消息说我必须运行“bundle install”,因为它无法在任何一个中找到rake-10.3.2来源(注意之前,rails服务器工作正常)。完成所有这些后,我再次尝试“rails server”,我收到了这条消息:

=> Booting WEBrick
=> Rails 4.1.4 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
=> Ctrl-C to shutdown server
Exiting
/home/ricardo/future/config/routes.rb:56:in `block in <top (required)>': uninitialized constant LetterOpenerWeb (NameError)
    from /home/ricardo/future/vendor/bundle/gems/actionpack-4.1.4/lib/action_dispatch/routing/route_set.rb:337:in `instance_exec'
    from /home/ricardo/future/vendor/bundle/gems/actionpack-4.1.4/lib/action_dispatch/routing/route_set.rb:337:in `eval_block'
    from /home/ricardo/future/vendor/bundle/gems/actionpack-4.1.4/lib/action_dispatch/routing/route_set.rb:315:in `draw'
    from /home/ricardo/future/config/routes.rb:1:in `<top (required)>'
    from /home/ricardo/future/vendor/bundle/gems/railties-4.1.4/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
    from /home/ricardo/future/vendor/bundle/gems/railties-4.1.4/lib/rails/application/routes_reloader.rb:40:in `each'
    from /home/ricardo/future/vendor/bundle/gems/railties-4.1.4/lib/rails/application/routes_reloader.rb:40:in `load_paths'
    from /home/ricardo/future/vendor/bundle/gems/railties-4.1.4/lib/rails/application/routes_reloader.rb:16:in `reload!'
    from /home/ricardo/future/vendor/bundle/gems/railties-4.1.4/lib/rails/application/routes_reloader.rb:26:in `block in updater'
    from /home/ricardo/future/vendor/bundle/gems/activesupport-4.1.4/lib/active_support/file_update_checker.rb:75:in `call'
    from /home/ricardo/future/vendor/bundle/gems/activesupport-4.1.4/lib/active_support/file_update_checker.rb:75:in `execute'
    from /home/ricardo/future/vendor/bundle/gems/railties-4.1.4/lib/rails/application/routes_reloader.rb:27:in `updater'
    from /home/ricardo/future/vendor/bundle/gems/railties-4.1.4/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
    from /home/ricardo/future/vendor/bundle/gems/railties-4.1.4/lib/rails/application/finisher.rb:71:in `block in <module:Finisher>'
    from /home/ricardo/future/vendor/bundle/gems/railties-4.1.4/lib/rails/initializable.rb:30:in `instance_exec'
    from /home/ricardo/future/vendor/bundle/gems/railties-4.1.4/lib/rails/initializable.rb:30:in `run'
    from /home/ricardo/future/vendor/bundle/gems/railties-4.1.4/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /home/ricardo/.rbenv/versions/2.1.4/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
    from /home/ricardo/.rbenv/versions/2.1.4/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
    from /home/ricardo/.rbenv/versions/2.1.4/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
    from /home/ricardo/.rbenv/versions/2.1.4/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
    from /home/ricardo/.rbenv/versions/2.1.4/lib/ruby/2.1.0/tsort.rb:345:in `each'
    from /home/ricardo/.rbenv/versions/2.1.4/lib/ruby/2.1.0/tsort.rb:345:in `call'
    from /home/ricardo/.rbenv/versions/2.1.4/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
    from /home/ricardo/.rbenv/versions/2.1.4/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
    from /home/ricardo/.rbenv/versions/2.1.4/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
    from /home/ricardo/future/vendor/bundle/gems/railties-4.1.4/lib/rails/initializable.rb:54:in `run_initializers'
    from /home/ricardo/future/vendor/bundle/gems/railties-4.1.4/lib/rails/application.rb:300:in `initialize!'
    from /home/ricardo/future/config/environment.rb:5:in `<top (required)>'
    from /home/ricardo/future/config.ru:3:in `block in <main>'
    from /home/ricardo/future/vendor/bundle/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
    from /home/ricardo/future/vendor/bundle/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
    from /home/ricardo/future/config.ru:in `new'
    from /home/ricardo/future/config.ru:in `<main>'
    from /home/ricardo/future/vendor/bundle/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
    from /home/ricardo/future/vendor/bundle/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
    from /home/ricardo/future/vendor/bundle/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
    from /home/ricardo/future/vendor/bundle/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
    from /home/ricardo/future/vendor/bundle/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
    from /home/ricardo/future/vendor/bundle/gems/railties-4.1.4/lib/rails/commands/server.rb:50:in `app'
    from /home/ricardo/future/vendor/bundle/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
    from /home/ricardo/future/vendor/bundle/gems/railties-4.1.4/lib/rails/commands/server.rb:130:in `log_to_stdout'
    from /home/ricardo/future/vendor/bundle/gems/railties-4.1.4/lib/rails/commands/server.rb:67:in `start'
    from /home/ricardo/future/vendor/bundle/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:81:in `block in server'
    from /home/ricardo/future/vendor/bundle/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:in `tap'
    from /home/ricardo/future/vendor/bundle/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:in `server'
    from /home/ricardo/future/vendor/bundle/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
    from /home/ricardo/future/vendor/bundle/gems/railties-4.1.4/lib/rails/commands.rb:17:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

我不知道为什么rake丢失或为什么/routes.rb出错了。 如果相关,请使用Ubuntu 16.04。

编辑:

来自/routes.rb的代码:

  55 if Rails.env.development?
  56  mount LetterOpenerWeb::Engine, at: "/letter_opener"
  57 end

编辑2:

的Gemfile:

group :development do
  gem 'annotate'
  gem 'letter_opener_web'
  gem "better_errors"
  gem "binding_of_caller"
end

Gemfile.lock的:

letter_opener (1.2.0)
  launchy (~> 2.2)
letter_opener_web (1.2.3)
  letter_opener (~> 1.0)
  rails (>= 3.2)

0 个答案:

没有答案