当我尝试启动rails服务器时,我收到一个错误

时间:2015-07-10 13:39:11

标签: ruby-on-rails ruby ruby-on-rails-4

这是错误

C:\Users\Евгений\silmple_cms2>rails server
C:/Users/Евгений/silmple_cms2/config/application.rb:7:in `<top (required)>': uni
nitialized constant Bundler (NameError)
        from C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_req
uire.rb:54:in `require'
        from C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_req
uire.rb:54:in `require'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.3/lib/rails/com
mands/commands_tasks.rb:78:in `block in server'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.3/lib/rails/com
mands/commands_tasks.rb:75:in `tap'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.3/lib/rails/com
mands/commands_tasks.rb:75:in `server'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.3/lib/rails/com
mands/commands_tasks.rb:39:in `run_command!'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.3/lib/rails/com
mands.rb:17:in `<top (required)>'
        from C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_req
uire.rb:128:in `require'
        from C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_req
uire.rb:128:in `rescue in require'
        from C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_req
uire.rb:39:in `require'
        from bin/rails:4:in `<main>'

C:\Users\Евгений\silmple_cms2>

2 个答案:

答案 0 :(得分:0)

似乎bundler似乎不存在。在启动服务器之前,请尝试:

gem install bundler

接下来是:

rails server

Incase bundler已经存在,清除所有bundler特定设置和缓存:

rm -rf .bundle/
rm -rf vendor/
rm -rf Gemfile.lockcache/

答案 1 :(得分:0)

类型: gem install bundler 安装处理所有宝石的bundler应用程序。

然后输入bundler install以完成并安装所有宝石。