2010-03-22 3 views
19

sto ottenendo un errore di bundler strano quando si eseguestrano errore bundler: tar_input.rb: 49: in `inizializzare ': non in formato gzip (Zlib :: :: GzipFile Error) sul fascio pacco

bundle pack 

con bundler 0.9.12

qualche idea? (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 
+0

avviene anche per me, ed è sfuggente nel mio caso, viene eseguito ripetute possono avviare l'applicazione con successo – dolzenko

risposta

14

a rispondere alla mia domanda:

la correzione è stato quello di eliminare tutti i contenuti da

vendor/cache 

dopo che ha funzionato.

chiaramente un bug di bundler.

2

aveva la stessa cosa, rimosso/bundler_gems/cache

4

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

bundle package 

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

+0

Questo ha funzionato per me, stessa configurazione. – edude05

+0

Questo ha funzionato anche per me. Puntelli! – mmay

1

rm -rf vendor/cache

bundle package

bundle install

bundle lock

E 'un po' fastidioso ... Non so il motivo per cui non posso fare bundle install --relock

21

stavo avendo problema simile con bundle upate (bundler 1.0). Sto usando rvm con gemset per la mia applicazione.

soluzione era quella di rimuovere:

~/.rvm/gems/[email protected]/cache

+0

Questo ha funzionato per me. – Avdi

+0

Ugh, non ha funzionato per me. Speravo davvero che lo sarebbe. Sto ancora facendo ricerche qui ... – Judy

+0

Questo ha funzionato per me. Vale la pena notare che dopo aver fatto ciò, ho dovuto eseguire l'installazione di bundle su tutte le mie app e gems usando bundler. – jbgo

1

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

0

Tutte le tracce di questo errore sono scomparse quando ho eseguito l'aggiornamento a Bundler 1.0.x.

2

Anche se eseguo Bundler 1.0.0, ho comunque riscontrato questo errore. bundle install non ha funzionato, ma eseguito bundle package fatto.

+0

idem. rimuovere la cache non ha avuto alcun effetto, ma il pacchetto lo ha risolto. –

7

Presumibilmente, il problema originale è stato risolto con Bundler 1.0.x, ma avevo ancora lo stesso messaggio di errore (utilizzando 1.0.3). Ho rimosso tutte le cartelle cache, incluse le directory RVM, come descritto nelle altre risposte qui, senza dadi.

Si scopre che verrà ottenere questo errore se Bundler non è in grado di risolvere una delle origini (ad esempio, quelle restituite da $ gem sources).Anche se si elencano più fonti, eseguirà il ping di tutte e se l'origine non è corretta, si bloccherà con questo errore non numerico 'initialize': not in gzip format.

Come descritto in this ticket, che può essere a causa di qualcosa come un VPM inaccessibile o origine di rete locale, ma in realtà ho incontrato il problema a causa del firewall della mia azienda che blocca rubygems.org.

Basta inviare questa risposta come un'altra soluzione possibile per chiarire questo messaggio di errore vago.

+0

Grazie, questo ha risolto il mio problema. –

0

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 
0

mi sono imbattuto in questo problema durante la distribuzione, ma non ha voluto 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 
Problemi correlati