Ruby on Rails服务器将无法运行

时间:2014-10-02 05:03:41

标签: ruby-on-rails ruby node.js ruby-on-rails-4 cmd

当我尝试启动应用程序时,为什么我的服务器没有运行?我安装了node.js,我相信我也安装了execjs,这既没有解决问题。不知道问题是什么。是的我是新人,所以请给我一些松懈!感谢

C:\Users\My-Name\first_app>rails server
=> Booting WEBrick
=> Rails 4.0.8 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
C:/Users/My-Name/first_app/config/environments/development.rb:1:in `<top (required)>': undefined method `configure' for #<FirstApp::Application:0x3b67c30>(NoMethodError)
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `require'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `block in require'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:214:in `load_dependency'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `require'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.8/lib/rails/engine.rb:591:in `block (2 levels) in <class:Engine>'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.8/lib/rails/engine.rb:590:in `each'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.8/lib/rails/engine.rb:590:in `block in <class:Engine>'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.8/lib/rails/initializable.rb:30:in `instance_exec'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.8/lib/rails/initializable.rb:30:in `run'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.8/lib/rails/initializable.rb:55:in `block in run_initializers'
    from C:/Ruby200/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
    from C:/Ruby200/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
    from C:/Ruby200/lib/ruby/2.0.0/tsort.rb:210:in `block (2 levels) in each_strongly_connected_component_from'
    from C:/Ruby200/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
    from C:/Ruby200/lib/ruby/2.0.0/tsort.rb:209:in `block in each_strongly_connected_component_from'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.8/lib/rails/initializable.rb:44:in `each'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.8/lib/rails/initializable.rb:44:in `tsort_each_child'
    from C:/Ruby200/lib/ruby/2.0.0/tsort.rb:203:in `each_strongly_connected_component_from'
    from C:/Ruby200/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
    from C:/Ruby200/lib/ruby/2.0.0/tsort.rb:180:in `each'
    from C:/Ruby200/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
    from C:/Ruby200/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.8/lib/rails/initializable.rb:54:in `run_initializers'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.8/lib/rails/application.rb:215:in `initialize!'
    from C:/Users/Devin Miller/first_app/config/environment.rb:5:in `<top (required)>'
    from C:/Users/Devin Miller/first_app/config.ru:3:in `require'
    from C:/Users/Devin Miller/first_app/config.ru:3:in `block in <main>'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
    from C:/Users/Devin Miller/first_app/config.ru:in `new'
    from C:/Users/Devin Miller/first_app/config.ru:in `<main>'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.8/lib/rails/commands/server.rb:48:in `app'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.8/lib/rails/commands/server.rb:75:in `start'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.8/lib/rails/commands.rb:76:in `block in <top (required)>'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.8/lib/rails/commands.rb:71:in `tap'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.8/lib/rails/commands.rb:71:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

1 个答案:

答案 0 :(得分:1)

FirstApp?我想你正在参加Hartl的教程。你是怎么安装rails的?

如果你通过rails安装程序安装了windows,可能你的版本高于4.0.8而你在Gemfile中手动切换版本,这种情况并不好。如果是这种情况,请从头开始安装4.0.8并使用它创建firstapp。的 [1]

开发的语法更改很少.rb,我认为即使你在那里手动更改文本它也行不通。您可以尝试将Rails.application.configure.do更改为FirstApp::Application.configure.do

请告诉我怎么回事。当您提供更多信息时,我会尝试更新我的答案。

[1]:

$ rails -v
$ gem uninstall rails --version VERSION
$ gem install rails --version VERSION