Rails服务器无法启动和发送消息

时间:2013-12-19 04:41:26

标签: ruby-on-rails macos terminal

我目前的ruby版本是ruby 2.0.0p247(2013-06-27修订版41674)[x86_64-darwin13.0.0] 和rails版本是4.0.0

每次运行任何rails命令时,我都会先收到以下消息:

/Users/aniruddhabarapatre1/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-     1.3.5/lib/bundler/runtime.rb:216: warning: Insecure world writable dir /usr/local in PATH, mode 040777

我能够创建新的rails应用程序,但是当我使用

启动服务器时
rails server

rails s

我收到以下消息

/Users/aniruddhabarapatre1/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:216: warning: Insecure world writable dir /usr/local in PATH, mode 040777
=> Booting WEBrick
=> Rails 4.0.0 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
/Users/aniruddhabarapatre1/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:10:in `rescue in execute_if_updated': Rails::Application::RoutesReloader#execute_if_updated delegated to updater.execute_if_updated, but updater is nil: #<Rails::Application::RoutesReloader:0x007f9019eec2c0 @paths=["/Users/aniruddhabarapatre1/RubyRails/profile/config/routes.rb"], @route_sets=[#<ActionDispatch::Routing::RouteSet:0x007f9019d795c8>]> (RuntimeError)
from /Users/aniruddhabarapatre1/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:6:in `execute_if_updated'
from /Users/aniruddhabarapatre1/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
from /Users/aniruddhabarapatre1/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/aniruddhabarapatre1/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
from /Users/aniruddhabarapatre1/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/aniruddhabarapatre1/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
from /Users/aniruddhabarapatre1/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /Users/aniruddhabarapatre1/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
from /Users/aniruddhabarapatre1/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
from /Users/aniruddhabarapatre1/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in `each'
from /Users/aniruddhabarapatre1/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
from /Users/aniruddhabarapatre1/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
from /Users/aniruddhabarapatre1/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/aniruddhabarapatre1/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
from /Users/aniruddhabarapatre1/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/aniruddhabarapatre1/RubyRails/profile/config/environment.rb:5:in `<top (required)>'
from /Users/aniruddhabarapatre1/RubyRails/profile/config.ru:3:in `require'
from /Users/aniruddhabarapatre1/RubyRails/profile/config.ru:3:in `block in <main>'
from /Users/aniruddhabarapatre1/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from /Users/aniruddhabarapatre1/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from /Users/aniruddhabarapatre1/RubyRails/profile/config.ru:in `new'
from /Users/aniruddhabarapatre1/RubyRails/profile/config.ru:in `<main>'
from /Users/aniruddhabarapatre1/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from /Users/aniruddhabarapatre1/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
from /Users/aniruddhabarapatre1/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
from /Users/aniruddhabarapatre1/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /Users/aniruddhabarapatre1/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
from /Users/aniruddhabarapatre1/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands/server.rb:48:in `app'
from /Users/aniruddhabarapatre1/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
from /Users/aniruddhabarapatre1/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands/server.rb:75:in `start'
from /Users/aniruddhabarapatre1/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:78:in `block in <top (required)>'
from /Users/aniruddhabarapatre1/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
from /Users/aniruddhabarapatre1/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'

我可以看到服务器由于某些错误而未启动。但我无法理解这里发生的事情。非常感谢任何帮助。

2 个答案:

答案 0 :(得分:1)

尝试递归 chmod

chmod -R o-w /usr/local/

答案 1 :(得分:0)

我的路线中有拼写错误.rb 修复它并解决了我的服务器问题。