Michael Hartl による ruby.railstutorial.org の本を読み始めたばかりで、最初の章まで作業を進めています。Mac book OS X、ターミナル、および Sublime Text を使用しています。Heroku への展開をテストするまでは、すべてが計画どおりに進んでいます。Heroku に接続して$ git push heroku
master コマンドを実行できます。しかし、展開は失敗します:
Installing sqlite3 (1.3.5) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite-devel' 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:
An error occurred while installing sqlite3 (1.3.5), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.5'` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Detected sqlite3 gem which is not supported on Heroku.
! http://devcenter.heroku.com/articles/how-do-i-use-sqlite3-for-development
!
! Heroku push rejected, failed to compile Ruby/rails app
これが私のGemfileです
source 'https://rubygems.org'
gem 'rails', '3.2.8'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :development, :test do
gem 'sqlite3', '1.3.5'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.5'
gem 'coffee-rails', '~> 3.2.2'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.2.3'
end
gem 'jquery-rails', '2.0.2'
group :production do
gem 'pg', '0.12.2'
end
# 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'
私はsqlite3を本番用ではなく開発用に指定しているので、Herokuはそれをすべて無視するだろうと思っていましたが、そうではないようです.
また、バンドルを作成するときに $ bundle install --without production を使用しています
一部の人々が PG をインストールしてそれを使用することを提案していることは知っていますが、思い切って別のアプローチを試す前に、可能な限りチュートリアルに固執したいと思います。
現時点では少し迷っており、ここから先に進む方法がわかりません。あなたが提供できるどんな助けも大歓迎です。
ありがとう