2011-11-01 17 views
25

ho eseguito i comandiHeroku - non può essere eseguito git push Heroku maestro

heroku create --stack cedar 
git push heroku master 

ma mi ha dato un errore:

> Counting objects: 144, done. Delta compression using up to 2 threads. 
> Compressing objects: 100% (128/128), done. Writing objects: 100% 
> (144/144), 50.16 KiB, done. Total 144 (delta 23), reused 0 (delta 0) 
> 
> -----> Heroku receiving push 
> -----> Ruby/Rails app detected 
> -----> Installing dependencies using Bundler version 1.1.rc 
>  Running: bundle install --without development:test --path vendor/bundle --deployment 
>  Fetching gem metadata from http://rubygems.org/....... 
>  Installing rake (0.9.2.2) 
>  Installing multi_json (1.0.3) 
>  Installing activesupport (3.1.1) 
>  Installing builder (3.0.0) 
>  Installing i18n (0.6.0) 
>  Installing activemodel (3.1.1) 
>  Installing erubis (2.7.0) 
>  Installing rack (1.3.5) 
>  Installing rack-cache (1.1) 
>  Installing rack-mount (0.8.3) 
>  Installing rack-test (0.6.1) 
>  Installing hike (1.2.1) 
>  Installing tilt (1.3.3) 
>  Installing sprockets (2.0.3) 
>  Installing actionpack (3.1.1) 
>  Installing mime-types (1.17.2) 
>  Installing polyglot (0.3.2) 
>  Installing treetop (1.4.10) 
>  Installing mail (2.3.0) 
>  Installing actionmailer (3.1.1) 
>  Installing arel (2.2.1) 
>  Installing tzinfo (0.3.30) 
>  Installing activerecord (3.1.1) 
>  Installing activeresource (3.1.1) 
>  Installing coffee-script-source (1.1.2) 
>  Installing execjs (1.2.9) 
>  Installing coffee-script (2.2.0) 
>  Installing rack-ssl (1.3.2) 
>  Installing json (1.6.1) with native extensions 
>  Installing rdoc (3.11) 
>  Installing thor (0.14.6) 
>  Installing railties (3.1.1) 
>  Installing coffee-rails (3.1.1) 
>  Installing jquery-rails (1.0.16) 
>  Installing pg (0.11.0) with native extensions 
>  Using bundler (1.1.rc) 
>  Installing rails (3.1.1) 
>  Installing sass (3.1.10) 
>  Installing sass-rails (3.1.4) 
>  **Installing sqlite3 (1.3.4) with native extensions Unfortunately, a fatal error has occurred. Please report this error to 
> the Bundler issue tracker at 
> https://github.com/carlhuda/bundler/issues so that we can fix it. 
> Thanks!** 
>  /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:483:in `rescue in block in build_extensions': ERROR: Failed to build gem native 
> extension. (Gem::Installer::ExtensionBuildError) 
>  /usr/local/bin/ruby extconf.rb 
>  checking for sqlite3.h... no 
>  sqlite3.h is missing. Try 'port install sqlite3 +universal' 
>  or 'yum install sqlite3-devel' and check your shared library search path (the 
>  location where your sqlite3 shared library is located). 
>  *** extconf.rb failed *** 
>  Could not create Makefile due to some reason, probably lack of 
>  necessary libraries and/or headers. Check the mkmf.log file for more 
>  details. You may need configuration options. 
>  Provided configuration options: 
>  --with-opt-dir 
>  --without-opt-dir 
>  --with-opt-include 
>  --without-opt-include=${opt-dir}/include 
>  --with-opt-lib 
>  --without-opt-lib=${opt-dir}/lib 
>  --with-make-prog 
>  --without-make-prog 
>  --srcdir=. 
>  --curdir 
>  --ruby=/usr/local/bin/ruby 
>  --with-sqlite3-dir 
>  --without-sqlite3-dir 
>  --with-sqlite3-include 
>  --without-sqlite3-include=${sqlite3-dir}/include 
>  --with-sqlite3-lib 
>  --without-sqlite3-lib=${sqlite3-dir}/lib 
>  --enable-local 
>  --disable-local 
>  Gem files will remain installed in /tmp/build_272b7nu18wwh5/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.4 
> for inspection. 
>  Results logged to /tmp/build_272b7nu18wwh5/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.4/ext/sqlite3/gem_make.out 
>  from /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:486:in `block in build_extensions' 
>  from /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:446:in `each' 
>  from /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:446:in `build_extensions' 
>  from /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:198:in `install' 
>  from /tmp/build_272b7nu18wwh5/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc/lib/bundler/source.rb:90:in 
> `block in install' 
>  from /tmp/build_272b7nu18wwh5/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc/lib/bundler/rubygems_integration.rb:78:in 
> `preserve_paths' 
>  from /tmp/build_272b7nu18wwh5/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc/lib/bundler/source.rb:89:in 
> `install' 
>  from /tmp/build_272b7nu18wwh5/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc/lib/bundler/installer.rb:73:in 
> `block in install_gem_from_spec' 
>  from /tmp/build_272b7nu18wwh5/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc/lib/bundler/rubygems_integration.rb:93:in 
> `with_build_args' 
>  from /tmp/build_272b7nu18wwh5/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc/lib/bundler/installer.rb:72:in 
> `install_gem_from_spec' 
>  from /tmp/build_272b7nu18wwh5/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc/lib/bundler/installer.rb:56:in 
> `block in run' 
>  from /tmp/build_272b7nu18wwh5/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc/lib/bundler/installer.rb:55:in 
> `run' 
>  from /tmp/build_272b7nu18wwh5/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc/lib/bundler/installer.rb:12:in 
> `install' 
>  from /tmp/build_272b7nu18wwh5/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc/lib/bundler/cli.rb:219:in 
> `install' 
>  from /tmp/build_272b7nu18wwh5/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc/lib/bundler/vendor/thor/task.rb:22:in 
> `run' 
>  from /tmp/build_272b7nu18wwh5/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task' 
>  from /tmp/build_272b7nu18wwh5/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc/lib/bundler/vendor/thor.rb:263:in 
> `dispatch' 
>  from /tmp/build_272b7nu18wwh5/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc/lib/bundler/vendor/thor/base.rb:386:in 
> `start' 
>  from /tmp/build_272b7nu18wwh5/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc/bin/bundle:13:in 
> `<top (required)>' 
>  from vendor/bundle/ruby/1.9.1/bin/bundle:19:in `load' 
>  from vendor/bundle/ruby/1.9.1/bin/bundle:19:in `<main>' ! !  Failed to install gems via Bundler. ! !  Heroku push rejected, 
> failed to compile Ruby/rails app 
> 
> To [email protected]:falling-ice-5948.git ! [remote rejected] master -> 
> master (pre-receive hook declined) error: failed to push some refs to 
> '[email protected]:falling-ice-5948.git' 

EDIT - Questo post potrebbe essere davvero utile: sqlite3-ruby install error

risposta

59

Aggiungi questo al tuo Gemfile,

group :production do 
    gem 'pg' 
end 
group :development, :test do 
    gem 'sqlite3' 
end 

quindi fare un bundle quindi riplasmare a heroku. Non è possibile utilizzare sqlite3 su Heroku, che è la causa dell'errore.

+0

Grazie, ma ho ancora lo stesso problema. La mia app non funziona quando nel file config/application.rb è config.assets..enabled = true, quando lo cambio su false funziona, ma non usa il mio file .css.Cosa dovrei fare ? Forse un array speciale exis quando devo aggiungere i miei file css? – ruhungry

+0

Anche questo non ha risolto il mio problema. – Mike

+1

La mia risposta è la soluzione per l'errore pubblicato nella domanda dei poster originali in merito a SQL3 non riuscendo a installare. Ulteriori problemi dovrebbero essere aperti come nuove domande. –

41

Se hai ancora il problema dopo aver rimosso sqlite3 dal Gemfile (o rendendolo solo per lo sviluppo) è che non hai aggiornato il file agli occhi di Heroku perché si basa su Git.

Molto semplicemente:

git add Gemfile 
git commit -m "Removed sqlite3 from Gemfile" 
git push heroku master 

ho sbattuto la testa contro questo per un po 'prima di rendersi conto che i cambiamenti non sono stati "prendendo" perché non avevo effettivamente impegnata a Heroku.

+0

+1 - Ho anche colpito la mia testa per lo stesso problema – Nobita

+1

+1 per aver ridotto la mia vita di una miseria –

+0

Dovevo fare git aggiungere Gemfile.lock una volta rimosso anche la dipendenza, ma questo ha funzionato per me. Grazie –

13

Questo è ciò che ha funzionato per me dopo un giorno di provare ogni correzione prescritta nei numerosi forum! Prima di tutto se stai usando il tutorial Rails o online devi passare alla seconda versione (c'è una versione beta online allo http://ruby.railstutorial.org/).

Aprite il vostro editor di aggiungere e nelle linee al vostro Gemfile:

group :production do  
    gem 'pg', '0.12.2' 
end 
group :development do 
    gem 'sqlite3', '1.3.4' 
end 

Ora è anche bisogno di commettere il vostro nuovo modificato Gemfile a Heroku così i passi successivi sono in ordine.

git add Gemfile 
git commit -m "Put Sqlite3 into development in the Gemfile" 
git push heroku master 
+0

molto utile grazie mille mi stavo dimenticando di fare un commit git –

+0

Grazie per questo. – Das

4

Se ancora non funziona per voi dopo l'applicazione Tibbon e le istruzioni di animuson (mi è successo), provare a lasciare un commento, al largo della "gemma 'sqlite3'" linea in Gemfile, quindi aggiungere-commit-push di nuovo.

+0

da esporre solo un po '... non vuoi avere alcun "conflitto" nel tuo gemfile, cioè rimuovere o commentare "il gemello originale" sqlite3' nella parte superiore del tuo gemfile (inserito quando creava in origine la tua app/scaffold). Questa riga 'gem sqlite3' è in conflitto o sovrascrive l'istruzione condizionale nella risposta precedente. E, se questo non è un problema, si avranno conflitti di versione con 'gem sqlite3' vs.' gem 'sqlite3', '1.3.4'' –

0

Ho seguito queste istruzioni, ma nel mio caso ho dovuto aggiungere il file Gemfile.lock aggiornato al controllo di versione. Quindi, ho usato il flag -a per "all" per aggiungere sia il file Gemfile che il file Gemfile.lock.

git commit -am "Put Sqlite3 into development in the Gemfile and added the updated Gemfile.lock"
git push heroku master

0

C'è una sintassi leggermente diversa è possibile utilizzare per risolvere questo problema:

gem 'pg', group: :production 
gem 'sqlite3', group: :development 
0

Se si dispone di un riferimento a:

# Use sqlite3 as the database for Active Record gem 'sqlite3'

nel vostro Gemfile, assicurarsi per commentare questo o sostituirlo con il codice suggerito sopra. Altrimenti, se questo rimane, continuerai a correre lo stesso errore.

Problemi correlati