strano errore Bundler: tar_input.rb: 49: in `inizializzare ': non in formato gzip (Zlib :: :: GzipFile Error) sul fascio confezione

StackOverflow https://stackoverflow.com/questions/2494659

Domanda

sto ottenendo un errore di bundler strano quando si esegue

bundle pack

con bundler 0.9.12

tutte le idee? (Vedi pastie per un codice migliore formattato: http://pastie.org/881328 )

/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:49:in `initialize': not in gzip format (Zlib::GzipFile::Error)
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:49:in `new'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:49:in `initialize'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:63:in `each'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:54:in `loop'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:54:in `each'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:32:in `initialize'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:17:in `new'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:17:in `open'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/site_ruby/1.8/rubygems/package.rb:55:in `open'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/site_ruby/1.8/rubygems/format.rb:63:in `from_io'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/site_ruby/1.8/rubygems/format.rb:51:in `from_file_by_path'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/site_ruby/1.8/rubygems/format.rb:50:in `open'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/site_ruby/1.8/rubygems/format.rb:50:in `from_file_by_path'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-0.9.12/lib/bundler/source.rb:115:in `specs'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-0.9.12/lib/bundler/source.rb:114:in `each'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-0.9.12/lib/bundler/source.rb:114:in `specs'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-0.9.12/lib/bundler/index.rb:32:in `from_cached_specs'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-0.9.12/lib/bundler/index.rb:23:in `application_cached_gems'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-0.9.12/lib/bundler/index.rb:15:in `cached_gems'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-0.9.12/lib/bundler/index.rb:5:in `build'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-0.9.12/lib/bundler/index.rb:14:in `cached_gems'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-0.9.12/lib/bundler/environment.rb:15:in `index'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-0.9.12/lib/bundler/index.rb:5:in `build'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-0.9.12/lib/bundler/environment.rb:13:in `index'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-0.9.12/lib/bundler/runtime.rb:86:in `specs'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-0.9.12/lib/bundler/runtime.rb:130:in `details'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-0.9.12/lib/bundler/runtime.rb:119:in `write_yml_lock'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-0.9.12/lib/bundler/runtime.rb:65:in `lock'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-0.9.12/lib/bundler/cli.rb:89:in `lock'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-0.9.12/lib/bundler/cli.rb:131:in `package'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-0.9.12/lib/bundler/vendor/thor/task.rb:33:in `send'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-0.9.12/lib/bundler/vendor/thor/task.rb:33:in `run'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-0.9.12/lib/bundler/vendor/thor/invocation.rb:109
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-0.9.12/lib/bundler/vendor/thor/invocation.rb:116:in `call'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-0.9.12/lib/bundler/vendor/thor/invocation.rb:116:in `invoke'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-0.9.12/lib/bundler/vendor/thor.rb:137:in `start'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-0.9.12/lib/bundler/vendor/thor/base.rb:378:in `start'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-0.9.12/lib/bundler/vendor/thor.rb:124:in `start'
  from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-0.9.12/bin/bundle:11
  from /opt/REE/bin/bundle:19:in `load'
  from /opt/REE/bin/bundle:19
È stato utile?

Soluzione 2

per rispondere alla mia domanda:

la correzione è stato quello di eliminare tutti i contenuti da

vendor/cache

dopo che ha funzionato.

chiaramente un bug fardellatrice.

Altri suggerimenti

ho avuto un problema simile con fascio upate (fardellatrice 1.0). Sto usando rvm con GemSET per la mia applicazione.

soluzione era quella di rimuovere:

~/.rvm/gems/ree-1.8.7-2010.02@gemset-name/cache

Presumibilmente, il problema originale è fissato con Bundler 1.0.x, ma ho ancora avuto lo stesso messaggio di errore (utilizzando 1.0.3). Ho rimosso tutte le cartelle cache, tra cui in directory RVM, come indicato nelle altre risposte qui -. Nessun dado

Si scopre avrete anche ottenere questo errore se Bundler non è possibile risolvere una delle fonti (cioè, quelli restituiti da $ gem sources). Anche se si elencano più fonti, sarà il ping tutti loro, e se qualsiasi fonte è male, andrà in crash con questo errore 'initialize': not in gzip format anonimo.

Come descritto nella questo biglietto , che possono essere a causa di qualcosa come un VPM inaccessibili o fonte di rete locale, ma in realtà ho incontrato il problema a causa di firewall che blocca rubygems.org della mia azienda.

Proprio presentando questa risposta come altro possibile soluzione per chiarire questo messaggio di errore vago.

appena accaduto a me con bundler 0.9.26 e Rails3 beta4. lanciato

bundle package

ora funziona. ma se rimuovo vendor / cache il problema persiste.

Ha avuto la stessa cosa, rimosso / bundler_gems / cache

Anche se sto correndo Bundler 1.0.0, ho ancora colpito questo errore. bundle install non ha funzionato, ma bundle package esecuzione ha fatto.

rm -rf vendor/cache

bundle package

bundle install

bundle lock

E 'un po' fastidioso ... Non so perché non posso fare bundle install --relock

Se stai usando Capistrano con require 'bundler/capistrano' di Bundler, la directory della cache è a shared/bundle/ruby/1.8/cache.

Tutte le tracce di questo errore è andato via quando ho aggiornato a Bundler 1.0.x.

Ho risolto questo problema in un rotaie 3.1 app eliminando i file archiviati gemma:

$ bundle -v
Bundler version 1.0.17
$ rm -f vendor/bundle/ruby/1.8/cache/*.gem

Mi sono imbattuto in questo problema durante la distribuzione, ma non volevo rimuovere vendor/cache da Git.

Invece, ho finito per fare questo:

# deploy.rb
namespace :bundle do
  desc "Removes vendor/cache when NO_GEM_CACHE=1 is set. Resolves Zlib::GzipFile::Error (not in gzip format)."
  task :remove_cache do
    run "rm -fr #{release_path}/vendor/cache" if ENV['NO_GEM_CACHE'] == '1'
  end
end
before :'bundle:install', :'bundle:remove_cache'

Ogni volta che questo errore affiora semplicemente:

cap deploy NO_GEM_CACHE=1
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top