![](/img/trans.png)
[英]git push heroku master: Error occurred while installing sqlite3
[英]Ruby on rails git push heroku master issue with sqlite3
我知道這是一個老問題,我看到許多與同一問題有關的問題。 我仍然不斷收到相同的錯誤。 我遵循了解決方案,並相應地更改了我的gemfile,但仍然遇到相同的問題。 我正在使用ubuntu。 當我按照Michael Hartl的教程中所述運行git push heroku master時,這是我的問題:
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=/usr/local/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}/lib
--enable-local
--disable-local
Gem files will remain installed in /tmp/build_t7ck4nq1x4dd/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.6 for inspection.
Results logged to /tmp/build_t7ck4nq1x4dd/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.6/ext/sqlite3/gem_make.out
An error occurred while installing sqlite3 (1.3.6), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.6'` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
To git@heroku.com:pure-dusk-8885.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:pure-dusk-8885.git'
這是我的寶石文件
source 'https://rubygems.org'
gem 'rails', '3.2.5'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :production do
gem 'pg'
end
group :development, :test do
gem 'sqlite3'
gem 'taps'
gem 'rvm'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'debugger'
請幫忙
從Gemfile中刪除sqlite3。 僅使用pg
gem進行開發,因此您可以在與要部署到的數據庫系統完全相同的數據庫系統上進行開發。
如果您不這樣做,那么在兩個數據庫系統之間進行轉換時可能會遇到問題。
正如Ryan Bigg所說,您在開發和生產中應該具有相同的環境,因此以后部署到生產中時不會感到驚訝。
但是,如果您對此不關心,並且希望保留sqlite,我認為您只需要運行bundle install
。 我猜您更改了GemFile,但未運行捆綁包安裝。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.