我一直在尝试推动Heroku,但这个错误阻止了我的进一步发展。
一开始,它说:remote:Your Gemfile lists the gem sqlite3 (>= 0) more than once.
但之后:
remote: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
remote: /tmp/build_d6d0f05e8da9cbfba1689173eab3d2d0/vendor/ruby-2.0.0/bin/ruby 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_d6d0f05e8da9cbfba1689173eab3d2d0/vendor/ruby-2.0.0/bin/ruby
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}/
remote: Gem files will remain installed in /tmp/build_d6d0f05e8da9cbfba1689173eab3d2d0/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.10 for inspection.
remote: Results logged to /tmp/build_d6d0f05e8da9cbfba1689173eab3d2d0/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.10/ext/sqlite3/gem_make.out
remote: An error occurred while installing sqlite3 (1.3.10), and Bundler cannot
remote: continue.
remote: Make sure that `gem install sqlite3 -v '1.3.10'` 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我已经尝试安装postgres,并在Gemfile中这样做:
gem 'sqlite3', group: [:development, :test]
gem 'pg', group: [:production]什么都不能用,我开始放弃Rails了..
发布于 2015-07-12 09:03:44
我强烈推荐在你的本地机器上使用postgres。如果您使用sqlite3进行开发并使用Heroku ( postgres ),您最终会遇到sqlite3可以接受但postgres拒绝的问题,因为postgres限制更多。意味着您对数据库所做的某些操作在本地工作,但将在heroku上出错,从而导致许多愤怒/沮丧。此外,在heroku和localhost上拥有相同的数据库也很好。如果它们都运行postgres,那么您可以向/从localhost/heroku推送和拉取副本。这样,您就可以始终使用相同的信息。
不管怎样,下面是我的gem文件的样子,我相信这是默认的。
Gemfile
source 'https://rubygems.org'
#gems for both development and production here
group :development, :test do
#gems for only development here
end
group :production do
#gems for only production here
endhttps://stackoverflow.com/questions/31356945
复制相似问题