Rails错误:`rescue in <top(required)=“”>':未初始化的常量Bundler(NameError)</top>

时间:2011-03-04 09:12:53

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

今天早些时候我用我的系统更新了宝石:

gem update

它更新了几个宝石,但在那之后我无法启动我的rails服务器,我收到了这个错误:

/Users/gugguson/rubys/my_rails_app/config/boot.rb:9:in `rescue in <top (required)>': uninitialized constant Bundler (NameError)
    from /Users/gugguson/rubys/my_rails_app/config/boot.rb:5:in `<top (required)>'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from script/rails:5:in `<main>'

如果我使用以下内容创建新应用

rails new test99

...然后进入文件夹并运行rails server s我收到此错误:

[~/rubys/test99] rails s
<internal:gem_prelude>:168:in `load_full_rubygems_library': undefined local variable or method `path' for Gem::QuickLoader:Module (NameError)
    from /Users/gugguson/.rvm/gems/ruby-head/gems/bundler-1.0.10/lib/bundler/rubygems_ext.rb:5:in `<top (required)>'
    from /Users/gugguson/.rvm/rubies/ruby-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/gugguson/.rvm/rubies/ruby-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/gugguson/.rvm/gems/ruby-head/gems/bundler-1.0.10/lib/bundler.rb:11:in `<top (required)>'
    from /Users/gugguson/.rvm/rubies/ruby-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/gugguson/.rvm/rubies/ruby-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/gugguson/.rvm/gems/ruby-head/gems/bundler-1.0.10/lib/bundler/setup.rb:4:in `<top (required)>'
    from /Users/gugguson/.rvm/rubies/ruby-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:53:in `require'
    from /Users/gugguson/.rvm/rubies/ruby-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:53:in `rescue in require'
    from /Users/gugguson/.rvm/rubies/ruby-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
    from /Users/gugguson/rubys/test99/config/boot.rb:6:in `<top (required)>'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from script/rails:5:in `<main>'

有什么想法吗?

谢谢, 约翰

1 个答案:

答案 0 :(得分:0)

正如lebreeze所说,尝试使用gem update --system更新rubygems。看起来有some issues并且它们已在最近的版本中修复。