捆绑安装错误:“重定向太多”

时间:2013-05-03 23:23:17

标签: ruby-on-rails ruby bundle

我无法在本地计算机上运行捆绑安装,我收到以下错误消息:

00:54:32-myuser~/myapp (master)$ bundle install --binstubs --path=vendor/bundle
Fetching source index from http://rubygems.org/
Too many redirects
00:55:40-myuser~/myapp (master)$

有什么线索发生了什么? 或者提议的任何解决方法?

详细模式给了我:

Fetching from: http://rubygems.org/api/v1/dependencies
HTTP Success
Fetching source index from http://rubygems.org/
Fetching from: http://rubygems.org/quick/Marshal.4.8/actionmailer-3.2.11.gemspec.rz
HTTP Redirection
Fetching from: http://bb-m.rubygems.org/quick/Marshal.4.8/actionmailer-3.2.11.gemspec.rz
HTTP Redirection
Fetching from: http://bb-m.rubygems.org/quick/Marshal.4.8/actionmailer-3.2.11.gemspec.rz
HTTP Redirection
Fetching from: http://bb-m.rubygems.org/quick/Marshal.4.8/actionmailer-3.2.11.gemspec.rz
HTTP Redirection
Fetching from: http://bb-m.rubygems.org/quick/Marshal.4.8/actionmailer-3.2.11.gemspec.rz
HTTP Redirection
Too many redirects
Bundler::HTTPError: Too many redirects
/home/kar/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/fetcher.rb:197:in `fetch'
/home/kar/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/fetcher.rb:222:in `fetch'
/home/kar/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/fetcher.rb:222:in `fetch'
/home/kar/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/fetcher.rb:222:in `fetch'
/home/kar/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/fetcher.rb:222:in `fetch'
/home/kar/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/fetcher.rb:222:in `fetch'
/home/kar/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/fetcher.rb:92:in `fetch_spec'
/home/kar/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/remote_specification.rb:46:in `_remote_specification'
/home/kar/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/remote_specification.rb:51:in `method_missing'
/home/kar/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/spec_set.rb:133:in `tsort_each_child'
/home/kar/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/tsort.rb:203:in `each_strongly_connected_component_from'
/home/kar/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/tsort.rb:182:in `block in each_strongly_connected_component'
/home/kar/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/spec_set.rb:129:in `block in tsort_each_node'
/home/kar/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/spec_set.rb:129:in `each'
/home/kar/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/spec_set.rb:129:in `tsort_each_node'
/home/kar/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/tsort.rb:180:in `each_strongly_connected_component'
/home/kar/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/tsort.rb:148:in `tsort_each'
/home/kar/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/tsort.rb:135:in `tsort'
/home/kar/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/spec_set.rb:112:in `sorted'
/home/kar/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/installer.rb:90:in `run'
/home/kar/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/installer.rb:14:in `install'
/home/kar/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/cli.rb:247:in `install'
/home/kar/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/vendor/thor/task.rb:27:in `run'
/home/kar/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task'
/home/kar/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/vendor/thor.rb:344:in `dispatch'
/home/kar/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/vendor/thor/base.rb:434:in `start'
/home/kar/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/bin/bundle:20:in `block in <top (required)>'
/home/kar/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/friendly_errors.rb:3:in `with_friendly_errors'
/home/kar/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/bin/bundle:20:in `<top (required)>'
/home/kar/.rbenv/versions/1.9.3-p194/bin/bundle:23:in `load'
/home/kar/.rbenv/versions/1.9.3-p194/bin/bundle:23:in `<main>'

非常感谢你的帮助。

1 个答案:

答案 0 :(得分:2)

我可以在以下帖子后终于摆脱我的问题:

https://github.com/carlhuda/bundler/issues/2451

我必须像这样修改fetcher.rb文件:

     if @connection.is_a?(Net::HTTP::Persistent)
       response = @connection.request(uri)
     else
      @connection = Net::HTTP.new(uri.host, uri.port)
       req = Net::HTTP::Get.new uri.request_uri
       response = @connection.request(req)
     end 

更多详情here