1

当我尝试运行命令“捆绑安装”或安装特定的 gem 时,就会出现 gzip 格式(Zlib::GzipFile::Error)。我已经完成谷歌搜索并找到了一些答案,例如删除缓存,捆绑包,但在我的情况下都失败了

我正在使用 rails 3.2.11 和 ruby​​ 1.8.7

rubygems line arround 500 的代码是

def self.gunzip(data)
  require 'stringio'
  require 'zlib'
  data = StringIO.new data

  Zlib::GzipReader.new(data).read
end

##
# Zlib::GzipWriter wrapper that zips +data+.

def self.gzip(data)
  require 'stringio'
  require 'zlib'
  zipped = StringIO.new

  Zlib::GzipWriter.wrap zipped do |io| io.write data end

  zipped.string
end

而控制台中的错误是

不幸的是,发生了致命错误。请参阅http://bit.ly/bundler-issues上的 Bundler 故障排除文档。谢谢!

/usr/lib/ruby/site_ruby/1.8/rubygems.rb:550:in `initialize': not in gzip format (Zlib::GzipFile::Error)
    from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:550:in `new'
    from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:550:in `gunzip'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:177:in `fetch_path'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:270:in `load_specs'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:243:in `list'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:239:in `each'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:239:in `list'
    from /usr/lib64/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/rubygems_integration.rb:104:in `fetch_specs'
    from /usr/lib64/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/rubygems_integration.rb:117:in `fetch_all_remote_specs'
    from /usr/lib64/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/fetcher.rb:262:in `fetch_all_remote_specs'
    from /usr/lib64/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/fetcher.rb:116:in `specs'
    from /usr/lib64/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:235:in `remote_specs'
    from /usr/lib64/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:235:in `each'
    from /usr/lib64/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:235:in `remote_specs'
    from /usr/lib64/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:163:in `fetch_specs'
    from /usr/lib64/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:67:in `specs'
    from /usr/lib64/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/definition.rb:192:in `index'
    from /usr/lib64/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/definition.rb:189:in `each'
    from /usr/lib64/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/definition.rb:189:in `index'
    from /usr/lib64/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/index.rb:9:in `build'
    from /usr/lib64/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/definition.rb:185:in `index'
    from /usr/lib64/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/definition.rb:179:in `resolve'
    from /usr/lib64/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/definition.rb:114:in `specs'
    from /usr/lib64/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/definition.rb:109:in `resolve_remotely!'
    from /usr/lib64/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/installer.rb:83:in `run'
    from /usr/lib64/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/installer.rb:14:in `install'
    from /usr/lib64/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/cli.rb:320:in `update'
    from /usr/lib64/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/vendor/thor/task.rb:27:in `__send__'
    from /usr/lib64/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/vendor/thor/task.rb:27:in `run'
    from /usr/lib64/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task'
    from /usr/lib64/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/vendor/thor.rb:344:in `dispatch'
    from /usr/lib64/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/vendor/thor/base.rb:434:in `start'
    from /usr/lib64/ruby/gems/1.8/gems/bundler-1.3.5/bin/bundle:20
    from /usr/lib64/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/friendly_errors.rb:3:in `with_friendly_errors'
    from /usr/lib64/ruby/gems/1.8/gems/bundler-1.3.5/bin/bundle:20
    from /usr/bin/bundle:19:in `load'
    from /usr/bin/bundle:19

希望这些信息足以为我提供正确的解决方案

4

0 回答 0