I'm trying to push my Rails app to Heroku but keep getting this error.
Installing sqlite3 (1.3.5) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
This is my Gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'pg'
gem 'thin'
# 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'
gem 'twitter-bootstrap-rails'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails', '~> 2.0.1'
gem 'modernizr-rails', '~> 2.0.6'
gem 'will_paginate', '~> 3.0.3'
gem 'simple_form', '~> 2.0.1'
gem 'friendly_id', '~> 4.0.4'
# Authentication
gem 'devise', '~> 2.0.4'
# gem 'recaptcha', :require => 'recaptcha/rails'
# Authorisation
gem 'cancan', '~> 1.6.7'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
and this is my gemlock file
GEM
remote: https://rubygems.org/
specs:
actionmailer (3.2.1)
actionpack (= 3.2.1)
mail (~> 2.4.0)
actionpack (3.2.1)
activemodel (= 3.2.1)
activesupport (= 3.2.1)
builder (~> 3.0.0)
erubis (~> 2.7.0)
journey (~> 1.0.1)
rack (~> 1.4.0)
rack-cache (~> 1.1)
rack-test (~> 0.6.1)
sprockets (~> 2.1.2)
activemodel (3.2.1)
activesupport (= 3.2.1)
builder (~> 3.0.0)
activerecord (3.2.1)
activemodel (= 3.2.1)
activesupport (= 3.2.1)
arel (~> 3.0.0)
tzinfo (~> 0.3.29)
activeresource (3.2.1)
activemodel (= 3.2.1)
activesupport (= 3.2.1)
activesupport (3.2.1)
i18n (~> 0.6)
multi_json (~> 1.0)
arel (3.0.2)
bcrypt-ruby (3.0.1)
builder (3.0.0)
cancan (1.6.7)
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
railties (~> 3.2.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.2.0)
commonjs (0.2.5)
daemons (1.1.8)
devise (2.0.4)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.0.3)
railties (~> 3.1)
warden (~> 1.1.1)
erubis (2.7.0)
eventmachine (0.12.10)
execjs (1.3.0)
multi_json (~> 1.0)
friendly_id (4.0.4)
hike (1.2.1)
i18n (0.6.0)
journey (1.0.3)
jquery-rails (2.0.2)
railties (>= 3.2.0, < 5.0)
thor (~> 0.14)
json (1.6.6)
less (2.1.0)
commonjs (~> 0.2.0)
therubyracer (~> 0.10.0)
less-rails (2.2.0)
actionpack (>= 3.1)
less (~> 2.1.0)
libv8 (3.3.10.4)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.18)
modernizr-rails (2.0.6)
multi_json (1.2.0)
orm_adapter (0.0.7)
pg (0.13.2)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
rack (>= 0.4)
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
rack (>= 1.0)
rails (3.2.1)
actionmailer (= 3.2.1)
actionpack (= 3.2.1)
activerecord (= 3.2.1)
activeresource (= 3.2.1)
activesupport (= 3.2.1)
bundler (~> 1.0)
railties (= 3.2.1)
railties (3.2.1)
actionpack (= 3.2.1)
activesupport (= 3.2.1)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
sass (3.1.15)
sass-rails (3.2.5)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
simple_form (2.0.1)
actionpack (~> 3.0)
activemodel (~> 3.0)
sprockets (2.1.2)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
therubyracer (0.10.0)
libv8 (~> 3.3.10)
thin (1.3.1)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
twitter-bootstrap-rails (2.0.5)
actionpack (>= 3.1)
less-rails (~> 2.2.0)
railties (>= 3.1)
tzinfo (0.3.32)
uglifier (1.2.4)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
warden (1.1.1)
rack (>= 1.0)
will_paginate (3.0.3)
PLATFORMS
ruby
DEPENDENCIES
cancan (~> 1.6.7)
coffee-rails (~> 3.2.1)
devise (~> 2.0.4)
friendly_id (~> 4.0.4)
jquery-rails (~> 2.0.1)
modernizr-rails (~> 2.0.6)
pg
rails (= 3.2.1)
sass-rails (~> 3.2.3)
simple_form (~> 2.0.1)
thin
twitter-bootstrap-rails
uglifier (>= 1.0.3)
will_paginate (~> 3.0.3)
I don't have any references to sqlite3 but it's still trying to install it. I have removed my gemfile.lock & Bundle install'd then git add + commit several times. Where am I going wrong? Many thanks!
I'd suggest using groups for your PostgreSQL gem. I'm not sure why it's trying to install sqlite3, but this may fix it.
group :development, :production do
gem 'pg'
end
I also had a situation where Rails did not seem to be choosing which db engine to use based on the way I had the Gemfile configured.
If you're on Mac OS X or Linux, check your environment variables to see if you have one called "DATABASE_URL". In my case, the Gemfile specified sqlite3 but I could tell Rails was using Postgres and I had no idea why until I came across environment variable set up with the PostgreSQL information.
I would also follow Adam's advice and set up groups.
http://stackoverflow.com/questions/3868992/bundler-trace-and-check-dependencies-in-bundled-ruby-gem - MotownJoe 2012-08-13 03:27
Make sure in which environment you are going to use database. You are trying to use PostgreSQL but you haven't decide in which environment you using it. so make group in gem file to use it. For example
group :development, :production do
gem 'pg'
end