启动服务器时退出:rails s

时间:2016-05-31 09:37:21

标签: ruby-on-rails ubuntu

启动服务器时退出:rails s。我的操作系统是Ubuntu 12.04。终端输出如下所示。

rails s
=> Booting Thin
=> Rails 4.2.6 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server

退出

 /home/jobi/Music/inaturalist-master/config/environments/development.rb:23:in `initialize': No such file or directory - /home/jobi/Music/inaturalist-master/config/smtp.yml (Errno::ENOENT)
  from /home/jobi/Music/inaturalist-master/config/environments/development.rb:23:in `open'
  from /home/jobi/Music/inaturalist-master/config/environments/development.rb:23:in `block in <top (required)>'
  from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.2.6/lib/rails/railtie.rb:210:in `instance_eval'
  from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.2.6/lib/rails/railtie.rb:210:in `configure'
  from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.2.6/lib/rails/railtie.rb:182:in `configure'
  from /home/jobi/Music/inaturalist-master/config/environments/development.rb:1:in `<top (required)>'
  from /usr/local/lib/ruby/gems/2.0.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
  from /usr/local/lib/ruby/gems/2.0.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
  from /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `block in require'
  from /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency'
  from /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'
  from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.2.6/lib/rails/engine.rb:598:in `block (2 levels) in <class:Engine>'
  from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.2.6/lib/rails/engine.rb:597:in `each'
  from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.2.6/lib/rails/engine.rb:597:in `block in <class:Engine>'
  from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.2.6/lib/rails/initializable.rb:30:in `instance_exec'
  from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.2.6/lib/rails/initializable.rb:30:in `run'
  from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.2.6/lib/rails/initializable.rb:55:in `block in run_initializers'
  from /usr/local/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
  from /usr/local/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
  from /usr/local/lib/ruby/2.0.0/tsort.rb:210:in `block (2 levels) in each_strongly_connected_component_from'
  from /usr/local/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
  from /usr/local/lib/ruby/2.0.0/tsort.rb:209:in `block in each_strongly_connected_component_from'
  from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.2.6/lib/rails/initializable.rb:44:in `each'
  from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.2.6/lib/rails/initializable.rb:44:in `tsort_each_child'
  from /usr/local/lib/ruby/2.0.0/tsort.rb:203:in `each_strongly_connected_component_from'
  from /usr/local/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
  from /usr/local/lib/ruby/2.0.0/tsort.rb:180:in `each'
  from /usr/local/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
  from /usr/local/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
  from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.2.6/lib/rails/initializable.rb:54:in `run_initializers'
  from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.2.6/lib/rails/application.rb:352:in `initialize!'
  from /home/jobi/Music/inaturalist-master/config/environment.rb:5:in `<top (required)>'
  from /usr/local/lib/ruby/gems/2.0.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
  from /usr/local/lib/ruby/gems/2.0.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
  from /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `block in require'
  from /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency'
  from /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'
  from /home/jobi/Music/inaturalist-master/config.ru:3:in `block in <main>'
  from /usr/local/lib/ruby/gems/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
  from /usr/local/lib/ruby/gems/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
  from /home/jobi/Music/inaturalist-master/config.ru:in `new'
  from /home/jobi/Music/inaturalist-master/config.ru:in `<main>'
  from /usr/local/lib/ruby/gems/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
  from /usr/local/lib/ruby/gems/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
  from /usr/local/lib/ruby/gems/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
  from /usr/local/lib/ruby/gems/2.0.0/gems/rack-1.6.4/lib/rack/server.rb:299:in `build_app_and_options_from_config'
  from /usr/local/lib/ruby/gems/2.0.0/gems/rack-1.6.4/lib/rack/server.rb:208:in `app'
  from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.2.6/lib/rails/commands/server.rb:61:in `app'
  from /usr/local/lib/ruby/gems/2.0.0/gems/rack-1.6.4/lib/rack/server.rb:336:in `wrapped_app'
  from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.2.6/lib/rails/commands/server.rb:139:in `log_to_stdout'
  from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.2.6/lib/rails/commands/server.rb:78:in `start'
  from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:80:in `block in server'
  from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in `tap'
  from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in `server'
  from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
  from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.2.6/lib/rails/commands.rb:17:in `<top (required)>'
  from bin/rails:4:in `require'
  from bin/rails:4:in `<main>'

1 个答案:

答案 0 :(得分:1)

development.rb文件中的某些内容要打开不存在的config/smtp.yml配置文件(参见第23行)。可能这是由于未正确配置宝石。如果您需要进一步的帮助,请在问题中添加development.rb