我正在使用Rails 3.2.6
和Ruby 1.9.3
。我创建了应用程序,并使用 git push 在GitHub存储库中推送该应用程序。
当我使用 git push heroku master 命令在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 git@heroku.com:quiet-bastion-4831.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:quiet-bastion-4831.git'
我无法得到它,发生了什么?
如何部署到Heroku?
答案 0 :(得分:2)
通过查看错误,我可以说您没有在本地运行assets:precompile
任务。
现在,在使用 git push heroku master 命令之前,您只需按照以下步骤操作:
RAILS_ENV=production bundle exec rake assets:precompile
git add public/assets
git commit -m "vendor compiled assets"
完成上述步骤后,使用 git push heroku master 命令,这将有助于将应用程序部署到Heroku。
您可以从此链接Rails Asset Pipeline on Heroku Cedar了解Heroku。
我希望这会对你有所帮助。