2014-06-21 57 views
1

我正在使用Rails 3.2.6Ruby 1.9.3。我創建了應用程序,並通過使用git push將該應用程序推送到GitHub存儲庫。當我運行git push heroku主控命令時,Heroku推送失敗

當我用混帳推Heroku的主命令部署在Heroku的應用程序,我得到了以下錯誤:

Initializing repository, done. 
Counting objects: 82, done. 
Delta compression using up to 2 threads. 
Compressing objects: 100% (64/64), done. 
Writing objects: 100% (82/82), 152.43 KiB, done. 
Total 82 (delta 10), reused 0 (delta 0) 

-----> Ruby app detected 
-----> Compiling Ruby/Rails 
-----> Using Ruby version: ruby-2.0.0 
-----> Installing dependencies using 1.5.2 
    New app detected loading default bundler cache 
    Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment 
    Fetching gem metadata from https://rubygems.org/......... 
    Fetching additional metadata from https://rubygems.org/.. 
    Using i18n (0.6.9) 
    Using builder (3.0.4) 
    Using erubis (2.7.0) 
    Using journey (1.0.4) 
    Using hike (1.2.3) 
    Using tilt (1.4.1) 
    Using rack (1.4.5) 
    Using mime-types (1.25.1) 
    Using polyglot (0.3.4) 
    Using arel (3.0.3) 
    Using coffee-script-source (1.7.0) 
    Using execjs (2.0.2) 
    Using json (1.8.1) 
    Installing multi_json (1.9.2) 
    Using bundler (1.5.2) 
    Installing rake (10.2.0) 
    Installing thor (0.19.1) 
    Using rack-cache (1.2) 
    Using rack-test (0.6.2) 
    Installing tzinfo (0.3.39) 
    Using treetop (1.4.15) 
    Using coffee-script (2.2.0) 
    Using rdoc (3.12.2) 
    Installing rack-ssl (1.3.4) 
    Installing sass (3.3.4) 
    Using sprockets (2.2.2) 
    Using mail (2.5.4) 
    Installing uglifier (2.5.0) 
    Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 
    /tmp/build_3ff255db-d2c4-4488-8306-68f5b04b882e/vendor/ruby-2.0.0/bin/ruby extconf.rb 
    checking for sqlite3.h... no 
    sqlite3.h is missing. Try 'port install sqlite3 +universal', 
    'yum install sqlite-devel' or 'apt-get install libsqlite3-dev' 
    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=/tmp/build_3ff255db-d2c4-4488-8306-68f5b04b882e/vendor/ruby-2.0.0/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}/ 
    --enable-local 
    --disable-local 
    Gem files will remain installed in /tmp/build_3ff255db-d2c4-4488-8306-68f5b04b882e/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.9 for inspection. 
    Results logged to /tmp/build_3ff255db-d2c4-4488-8306-68f5b04b882e/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.9/ext/sqlite3/gem_make.out 
    Installing activesupport (3.2.16) 
    An error occurred while installing sqlite3 (1.3.9), and Bundler cannot continue. 
    Make sure that `gem install sqlite3 -v '1.3.9'` succeeds before bundling. 
    Bundler Output: Fetching gem metadata from https://rubygems.org/......... 
    Fetching additional metadata from https://rubygems.org/.. 
    Using i18n (0.6.9) 
    Using builder (3.0.4) 
    Using erubis (2.7.0) 
    Using journey (1.0.4) 
    Using hike (1.2.3) 
    Using tilt (1.4.1) 
    Using rack (1.4.5) 
    Using mime-types (1.25.1) 
    Using polyglot (0.3.4) 
    Using arel (3.0.3) 
    Using coffee-script-source (1.7.0) 
    Using execjs (2.0.2) 
    Using json (1.8.1) 
    Installing multi_json (1.9.2) 
    Using bundler (1.5.2) 
    Installing rake (10.2.0) 
    Installing thor (0.19.1) 
    Using rack-cache (1.2) 
    Using rack-test (0.6.2) 
    Installing tzinfo (0.3.39) 
    Using treetop (1.4.15) 
    Using coffee-script (2.2.0) 
    Using rdoc (3.12.2) 
    Installing rack-ssl (1.3.4) 
    Installing sass (3.3.4) 
    Using sprockets (2.2.2) 
    Using mail (2.5.4) 
    Installing uglifier (2.5.0) 

    Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 

    /tmp/build_3ff255db-d2c4-4488-8306-68f5b04b882e/vendor/ruby-2.0.0/bin/ruby extconf.rb 
    checking for sqlite3.h... no 
    sqlite3.h is missing. Try 'port install sqlite3 +universal', 
    'yum install sqlite-devel' or 'apt-get install libsqlite3-dev' 
    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=/tmp/build_3ff255db-d2c4-4488-8306-68f5b04b882e/vendor/ruby-2.0.0/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}/ 
    --enable-local 
    --disable-local 


    Gem files will remain installed in /tmp/build_3ff255db-d2c4-4488-8306-68f5b04b882e/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.9 for inspection. 
    Results logged to /tmp/build_3ff255db-d2c4-4488-8306-68f5b04b882e/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.9/ext/sqlite3/gem_make.out 
    Installing activesupport (3.2.16) 
    An error occurred while installing sqlite3 (1.3.9), and Bundler cannot continue. 
    Make sure that `gem install sqlite3 -v '1.3.9'` succeeds before bundling. 
! 
!  Failed to install gems via Bundler. 
!  
!  Detected sqlite3 gem which is not supported on Heroku. 
!  https://devcenter.heroku.com/articles/sqlite3 
! 

!  Push rejected, failed to compile Ruby app 

To [email protected]:quiet-bastion-4831.git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to '[email protected]:quiet-bastion-4831.git' 

我能不明白,到底是怎麼回事?

我該如何能夠部署到Heroku?

+0

可能重複的[無法將Git回購項目部署到Heroku](http://stackoverflow.com/questions/18511389/unable-to-deploy-git-repo-project-into-heroku) –

+0

@ user2062950:I在你的開發和測試組中使用'sqlite3',但是我得到了同樣的錯誤。 – user3690932

回答

2

看到錯誤,我可以說你沒有在本地運行assets:precompile任務。

現在,使用混帳推Heroku的主命令之前,你只要按照下面的步驟:

RAILS_ENV=production bundle exec rake assets:precompile 
git add public/assets 
git commit -m "vendor compiled assets" 

完成以上步驟之後,使用混帳推Heroku的主命令,這將有助於部署應用程序的Heroku 。

你可以從這個鏈接Rails Asset Pipeline on Heroku Cedar閱讀關於Heroku。

我希望這會幫助你。

+0

這個ans適合我。 – user3690932