【发布时间】:2015-07-13 04:22:03
【问题描述】:
这个问题我快疯了。
我是 Heroku 的新手,今天我正在尝试部署我的应用程序,但我做不到。我可以构建一次,但它给了我一个“内部服务器错误”。
错误:
当我运行git push heroku master 时,提交后,它返回:
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
###### WARNING:
Removing `Gemfile.lock` because it was generated on Windows.
Bundler will do a full resolve so native gems are handled properly.
This may result in unexpected gem versions being used in your app.
In rare occasions Bundler may not be able to resolve your dependencies at all.
https://devcenter.heroku.com/articles/bundler-windows-gemfile
-----> Installing dependencies using 1.7.12
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Using json 1.8.2
Using i18n 0.7.0
...
Using sass-rails 5.0.3
Using turbolinks 2.5.3
Installing bootstrap-sass 3.2.0.2
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/tmp/build_4e3945a34652ba20ca13b13d160a9dd7/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_4e3945a34652ba20ca13b13d160a9dd7/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}/
Gem files will remain installed in /tmp/build_4e3945a34652ba20ca13b13d160a9dd7/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.10 for inspection.
Results logged to /tmp/build_4e3945a34652ba20ca13b13d160a9dd7/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.10/ext/sqlite3/gem_make.out
An error occurred while installing sqlite3 (1.3.10), and Bundler cannot
continue.
Make sure that `gem install sqlite3 -v '1.3.10'` succeeds before bundling.
Bundler Output: Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Using json 1.8.2
Using i18n 0.7.0
...
Using sass-rails 5.0.3
Using turbolinks 2.5.3
Installing bootstrap-sass 3.2.0.2
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/tmp/build_4e3945a34652ba20ca13b13d160a9dd7/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_4e3945a34652ba20ca13b13d160a9dd7/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}/
Gem files will remain installed in /tmp/build_4e3945a34652ba20ca13b13d160a9dd7/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.10 for inspection.
Results logged to /tmp/build_4e3945a34652ba20ca13b13d160a9dd7/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.10/ext/sqlite3/gem_make.out
An error occurred while installing sqlite3 (1.3.10), and Bundler cannot
continue.
Make sure that `gem install sqlite3 -v '1.3.10'` 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
如果这是一个简单的错误,请原谅我。但这让我很头疼。
【问题讨论】:
-
阅读 heroku 文档。你不能在heroku上运行sqlite。必须是 postgres。
-
我的网站没有bd。我不需要 pg 或 sqlite3,但我得到同样的错误@Gene [stackoverflow.com/questions/30019003/…
-
@suslov 有问题。我是否需要提交所做的每项更改?感谢您的宝贵时间!
-
@DavidM:好吧,只有当你想要推送不同的东西时。
-
您的 gem 文件中是否只有开发/测试块中的 sqlite3 gem?
标签: ruby-on-rails ruby-on-rails-4 heroku sqlite