Heroku拒绝第一次推送Rails应用程序

时间:2016-02-14 00:32:39

标签: ruby-on-rails heroku sqlite

我刚刚在Heroku上创建了一个app来安装我的rails应用程序,我正试图第一次推送。似乎很多事情都失败了,但我不确切知道是什么。这是日志:

Counting objects: 98, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (87/87), done.
Writing objects: 100% (98/98), 214.77 KiB | 0 bytes/s, done.
Total 98 (delta 8), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.2.4
remote: -----> Installing dependencies using bundler 1.9.7
remote:        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote:        Fetching gem metadata from https://rubygems.org/...........
remote:        Fetching version metadata from https://rubygems.org/...
remote:        Fetching dependency metadata from https://rubygems.org/..
remote:        Installing i18n 0.7.0
remote:        Installing rake 10.5.0
remote:        Installing minitest 5.8.4
remote:        Installing builder 3.2.2
remote:        Installing thread_safe 0.3.5
remote:        Installing mini_portile2 2.0.0
remote:        Installing erubis 2.7.0
remote:        Installing mime-types 2.99
remote:        Installing json 1.8.3
remote:        Installing rack 1.6.4
remote:        Installing arel 6.0.3
remote:        Installing coffee-script-source 1.10.0
remote:        Installing execjs 2.6.0
remote:        Installing thor 0.19.1
remote:        Using bundler 1.9.7
remote:        Installing multi_json 1.11.2
remote:        Installing concurrent-ruby 1.0.0
remote:        Installing tilt 2.0.2
remote:        Installing sass 3.4.21
remote:        Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
remote:        /tmp/build_84631dc00e714fc859136f5075e7ce25/vendor/ruby-2.2.4/bin/ruby -r ./siteconf20160214-318-tcurx0.rb extconf.rb
remote:        checking for sqlite3.h... no
remote:        sqlite3.h is missing. Try 'port install sqlite3 +universal',
remote:        'yum install sqlite-devel' or 'apt-get install libsqlite3-dev'
remote:        and check your shared library search path (the
remote:        location where your sqlite3 shared library is located).
remote:        *** extconf.rb failed ***
remote:        Could not create Makefile due to some reason, probably lack of necessary
remote:        libraries and/or headers.  Check the mkmf.log file for more details.  You may
remote:        need configuration options.
remote:        Provided configuration options:
remote:        --with-opt-dir
remote:        --without-opt-dir
remote:        --with-opt-include
remote:        --without-opt-include=${opt-dir}/include
remote:        --with-opt-lib
remote:        --without-opt-lib=${opt-dir}/lib
remote:        --with-make-prog
remote:        --without-make-prog
remote:        --srcdir=.
remote:        --curdir
remote:        --ruby=/tmp/build_84631dc00e714fc859136f5075e7ce25/vendor/ruby-2.2.4/bin/$(RUBY_BASE_NAME)
remote:        --with-sqlite3-dir
remote:        --without-sqlite3-dir
remote:        --with-sqlite3-include
remote:        --without-sqlite3-include=${sqlite3-dir}/include
remote:        --with-sqlite3-lib
remote:        --without-sqlite3-lib=${sqlite3-dir}/lib
remote:        extconf failed, exit code 1
remote:        Gem files will remain installed in /tmp/build_84631dc00e714fc859136f5075e7ce25/vendor/bundle/ruby/2.2.0/gems/sqlite3-1.3.11 for inspection.
remote:        Results logged to /tmp/build_84631dc00e714fc859136f5075e7ce25/vendor/bundle/ruby/2.2.0/extensions/x86_64-linux/2.2.0-static/sqlite3-1.3.11/gem_make.out
remote:        Installing tzinfo 1.2.2
remote:        Installing mail 2.6.3
remote:        Installing rack-test 0.6.3
remote:        Installing rdoc 4.2.2
remote:        Installing uglifier 2.7.2
remote:        Installing coffee-script 2.4.1
remote:        Installing sprockets 3.5.2
remote:        Installing nokogiri 1.6.7.2
remote:        An error occurred while installing sqlite3 (1.3.11), and Bundler cannot
remote:        continue.
remote:        Make sure that `gem install sqlite3 -v '1.3.11'` succeeds before bundling.
remote:        Bundler Output: Fetching gem metadata from https://rubygems.org/...........
remote:        Fetching version metadata from https://rubygems.org/...
remote:        Fetching dependency metadata from https://rubygems.org/..
remote:        Installing i18n 0.7.0
remote:        Installing rake 10.5.0
remote:        Installing minitest 5.8.4
remote:        Installing builder 3.2.2
remote:        Installing thread_safe 0.3.5
remote:        Installing mini_portile2 2.0.0
remote:        Installing erubis 2.7.0
remote:        Installing mime-types 2.99
remote:        Installing json 1.8.3
remote:        Installing rack 1.6.4
remote:        Installing arel 6.0.3
remote:        Installing coffee-script-source 1.10.0
remote:        Installing execjs 2.6.0
remote:        Installing thor 0.19.1
remote:        Using bundler 1.9.7
remote:        Installing multi_json 1.11.2
remote:        Installing concurrent-ruby 1.0.0
remote:        Installing tilt 2.0.2
remote:        Installing sass 3.4.21
remote:        
remote:        Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
remote:        
remote:        /tmp/build_84631dc00e714fc859136f5075e7ce25/vendor/ruby-2.2.4/bin/ruby -r ./siteconf20160214-318-tcurx0.rb extconf.rb
remote:        checking for sqlite3.h... no
remote:        sqlite3.h is missing. Try 'port install sqlite3 +universal',
remote:        'yum install sqlite-devel' or 'apt-get install libsqlite3-dev'
remote:        and check your shared library search path (the
remote:        location where your sqlite3 shared library is located).
remote:        *** extconf.rb failed ***
remote:        Could not create Makefile due to some reason, probably lack of necessary
remote:        libraries and/or headers.  Check the mkmf.log file for more details.  You may
remote:        need configuration options.
remote:        
remote:        Provided configuration options:
remote:        --with-opt-dir
remote:        --without-opt-dir
remote:        --with-opt-include
remote:        --without-opt-include=${opt-dir}/include
remote:        --with-opt-lib
remote:        --without-opt-lib=${opt-dir}/lib
remote:        --with-make-prog
remote:        --without-make-prog
remote:        --srcdir=.
remote:        --curdir
remote:        --ruby=/tmp/build_84631dc00e714fc859136f5075e7ce25/vendor/ruby-2.2.4/bin/$(RUBY_BASE_NAME)
remote:        --with-sqlite3-dir
remote:        --without-sqlite3-dir
remote:        --with-sqlite3-include
remote:        --without-sqlite3-include=${sqlite3-dir}/include
remote:        --with-sqlite3-lib
remote:        --without-sqlite3-lib=${sqlite3-dir}/lib
remote:        
remote:        extconf failed, exit code 1
remote:        
remote:        Gem files will remain installed in /tmp/build_84631dc00e714fc859136f5075e7ce25/vendor/bundle/ruby/2.2.0/gems/sqlite3-1.3.11 for inspection.
remote:        Results logged to /tmp/build_84631dc00e714fc859136f5075e7ce25/vendor/bundle/ruby/2.2.0/extensions/x86_64-linux/2.2.0-static/sqlite3-1.3.11/gem_make.out
remote:        Installing tzinfo 1.2.2
remote:        Installing mail 2.6.3
remote:        Installing rack-test 0.6.3
remote:        Installing rdoc 4.2.2
remote:        Installing uglifier 2.7.2
remote:        Installing coffee-script 2.4.1
remote:        Installing sprockets 3.5.2
remote:        Installing nokogiri 1.6.7.2
remote:        An error occurred while installing sqlite3 (1.3.11), and Bundler cannot
remote:        continue.
remote:        Make sure that `gem install sqlite3 -v '1.3.11'` succeeds before bundling.
remote:  !
remote:  !     Failed to install gems via Bundler.
remote:  !     
remote:  !     Detected sqlite3 gem which is not supported on Heroku.
remote:  !     https://devcenter.heroku.com/articles/sqlite3
remote:  !
remote: 
remote:  !     Push rejected, failed to compile Ruby app
remote: 
remote: Verifying deploy...
remote: 
remote: !   Push rejected to infinite-citadel-84574.
remote: 
To https://git.heroku.com/infinite-citadel-84574.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/infinite-citadel-84574.git'

我尝试手动安装sqlite3版本1.3.11并且安装得很好,但是我仍然遇到错误。我还尝试运行apt-get install libsqlite3-dev行来解决丢失的sqlite3.h文件问题,但该软件包已经安装。我还尝试运行rake assets:precompile预先编译应用程序,然后再将其上传到heroku,这是我在另一篇文章中读到的内容。

1 个答案:

答案 0 :(得分:2)

Heroku不支持sqlite:https://devcenter.heroku.com/articles/sqlite3

您需要使用postgresql数据库设置您的应用程序才能在Heroku上运行:https://devcenter.heroku.com/articles/heroku-postgresql#connecting-in-ruby