Rails error: `rescue in <top (required)>': uninitialized constant Bundler (NameError)

亡梦爱人 提交于 2020-01-02 12:02:33

问题


Earlier today I updated gems on my system with:

gem update

It updated few gems but after that I can't start my rails server, I get this error:

/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>'

If I create a new app with:

rails new test99

... and then go into the folder and run rails server s I get this error:

[~/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>'

Any ideas?

Thanks, Johann


回答1:


As lebreeze said, try updating rubygems with gem update --system. Looks like there were some issues and that they were fixed in recent versions.



来源:https://stackoverflow.com/questions/5191741/rails-error-rescue-in-top-required-uninitialized-constant-bundler-namee

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!