运行rails服务器时出错,检查rails版本时出错

时间:2013-11-13 04:57:38

标签: ruby-on-rails ruby ruby-on-rails-3

我正在尝试运行rails服务器。

出乎意料的是,我在检查Rails的版本时发现了这个错误:

C:\>rails -v
Rails 3.2.8

请参阅上面的命令及以下命令。一个是'C'驱动器,另一个是我的项目目录

C:\Mukesh\workspace\Rails\tgif_api>rails version
C:/Users/Administrator/Desktop/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/rubygems_integration.rb:187:in `stub_source_index170': uninitialized constant Gem::SourceIndex (NameError)
    from C:/Users/Administrator/Desktop/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/rubygems_integration.rb:353:in `stub_rubygems'
    from C:/Users/Administrator/Desktop/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/rubygems_integration.rb:250:in `replace_entrypoints'
    from C:/Users/Administrator/Desktop/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/runtime.rb:14:in `setup'
    from C:/Users/Administrator/Desktop/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler.rb:107:in `setup'
    from C:/Users/Administrator/Desktop/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/setup.rb:7:in `<top (required)>'
    from C:/Users/Administrator/Desktop/ruby/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:135:in `require'
    from C:/Users/Administrator/Desktop/ruby/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
    from C:/Users/Administrator/Desktop/ruby/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:144:in `require'
    from C:/Mukesh/workspace/Rails/tgif_api/config/boot.rb:6:in `<top (required)>'
    from C:/Users/Administrator/Desktop/ruby/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
    from C:/Users/Administrator/Desktop/ruby/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
    from script/rails:5:in `<main>'

我已经尝试过系统更新并运行bundle install。执行bundle install时,即使我已成功安装try gem install rake,也会重复显示{{1}}。

1 个答案:

答案 0 :(得分:0)

您需要更新Bundler:gem update bundler