Ruby on rails 捆绑安装不工作(NoMethodError)

Ruby on rails 捆绑安装不工作(NoMethodError),ruby-on-rails,Ruby On Rails,嗨,我是rails新手,我正在尝试运行“bundle install”,只是我一直收到以下消息: $ bundle install Fetching source index for http://rubygems.org/ /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/source.rb:253:in `fetch_all_remote_specs': undefined method `list' for #<

嗨,我是rails新手,我正在尝试运行“bundle install”,只是我一直收到以下消息:

$ bundle install
Fetching source index for http://rubygems.org/
/usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/source.rb:253:in     `fetch_all_remote_specs': undefined method `list' for #<Gem::SpecFetcher:0x000006002f13a8> (NoMethodError)
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/source.rb:234:in `block in remote_specs'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/source.rb:231:in `each'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/source.rb:231:in `remote_specs'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/source.rb:165:in `fetch_specs'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/source.rb:70:in `specs'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/definition.rb:176:in `block (2 levels) in index'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/definition.rb:175:in `each'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/definition.rb:175:in `block in index'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/index.rb:7:in `build'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/definition.rb:174:in `index'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/definition.rb:168:in `resolve'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/definition.rb:107:in `specs'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/definition.rb:102:in `resolve_remotely!'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/installer.rb:43:in `run'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/installer.rb:8:in `install'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/cli.rb:219:in `install'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/vendor/thor/task.rb:22:in `run'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/vendor/thor.rb:263:in `dispatch'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/vendor/thor/base.rb:386:in `start'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/bin/bundle:13:in `<top (required)>'
    from /usr/bin/bundle:23:in `load'
    from /usr/bin/bundle:23:in `<main>'
我重新安装了rails和bundler,但没有成功。 如果没有bundle安装,我无法使用新应用。请提供帮助?

似乎您需要更新Bundler。请尝试:

检查

更新: 您可以在Gemfile中选择gem uninstall bundler select older version来删除旧版本,也可以为您的rails应用程序指定确切的版本


尝试将bundler更新为1.6和/或ruby更新为>2.0.0我得到bundler找不到与gem bundler兼容的版本:在Gemfile:rails=3.0.0 ruby依赖bundler~>1.0.0 ruby更新答案中的建议解决方案,并让我知道进展如何!
gem update bundler
gem 'bundler', '~> 1.6.2' #VERSION OF NEWER BUNDLER