启动Rails服务器时出错

时间:2016-04-15 20:30:18

标签: ruby-on-rails ruby

我刚刚将我的ruby从1.9.3升级到2.0.0,然后创建了一个新的rails项目。创建项目后,我尝试运行rails server但是出现以下错误:

root@giri:~/sr# rails s

/home/giri/.rvm/gems/ruby-2.0.0-p576/gems/actionpack-4.1.6/lib/action_controller/metal/strong_parameters.rb:106: warning: already initialized constant ActionController::Parameters::NEVER_UNPERMITTED_PARAMS
/home/giri/.rvm/gems/ruby-2.0.0-p576/gems/actionpack-4.1.6/lib/action_controller/metal/strong_parameters.rb:106: warning: previous definition of NEVER_UNPERMITTED_PARAMS was here
/home/giri/.rvm/gems/ruby-2.0.0-p576/gems/actionpack-4.1.6/lib/action_controller/metal/strong_parameters.rb:106: warning: already initialized constant ActionController::Parameters::NEVER_UNPERMITTED_PARAMS
/home/giri/.rvm/gems/ruby-2.0.0-p576/gems/actionpack-4.1.6/lib/action_controller/metal/strong_parameters.rb:106: warning: previous definition of NEVER_UNPERMITTED_PARAMS was here
/home/giri/.rvm/gems/ruby-2.0.0-p576/gems/coffee-rails-4.0.1/lib/coffee-rails.rb:1:in `require': cannot load such file -- coffee-script (LoadError)
    from /home/giri/.rvm/gems/ruby-2.0.0-p576/gems/coffee-rails-4.0.1/lib/coffee-rails.rb:1:in `<top (required)>'
    from /home/giri/.rvm/gems/ruby-2.0.0-p576/gems/bundler-1.12.0.rc/lib/bundler/runtime.rb:88:in `require'
    from /home/giri/.rvm/gems/ruby-2.0.0-p576/gems/bundler-1.12.0.rc/lib/bundler/runtime.rb:88:in `block (2 levels) in require'
    from /home/giri/.rvm/gems/ruby-2.0.0-p576/gems/bundler-1.12.0.rc/lib/bundler/runtime.rb:83:in `each'
    from /home/giri/.rvm/gems/ruby-2.0.0-p576/gems/bundler-1.12.0.rc/lib/bundler/runtime.rb:83:in `block in require'
    from /home/giri/.rvm/gems/ruby-2.0.0-p576/gems/bundler-1.12.0.rc/lib/bundler/runtime.rb:72:in `each'
    from /home/giri/.rvm/gems/ruby-2.0.0-p576/gems/bundler-1.12.0.rc/lib/bundler/runtime.rb:72:in `require'
    from /home/giri/.rvm/gems/ruby-2.0.0-p576/gems/bundler-1.12.0.rc/lib/bundler.rb:102:in `require'
    from /home/giri/sr/config/application.rb:7:in `<top (required)>'
    from /home/giri/.rvm/gems/ruby-2.0.0-p576/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:79:in `require'
    from /home/giri/.rvm/gems/ruby-2.0.0-p576/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:79:in `block in server'
    from /home/giri/.rvm/gems/ruby-2.0.0-p576/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:76:in `tap'
    from /home/giri/.rvm/gems/ruby-2.0.0-p576/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:76:in `server'
    from /home/giri/.rvm/gems/ruby-2.0.0-p576/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
    from /home/giri/.rvm/gems/ruby-2.0.0-p576/gems/railties-4.1.6/lib/rails/commands.rb:17:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

2 个答案:

答案 0 :(得分:0)

warning: already initialized constant

如果捆绑包中的版本与命令行不同,则会发生此类错误。

尝试bundle exec rails s

答案 1 :(得分:0)

尝试删除缓存。它位于tmp文件夹