tawheed
tawheed

Reputation: 5821

Heroku failing to deploy because of sqlite3

This is a bit odd, but I just updated my machine to use ruby 2.0 and rails 4.0 but I keep getting errors when I attempt to push to a heroku repository. I get something in the lines of

/tmp/build_1f394d14-4e73-419e-9e8f-3bb30d37dc63/vendor/ruby-2.0.0/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 ***

So the obvious problem here is that sqlite3 is not installed that is why it is failing. I followed the following steps to install sqlite3

$: port install sqlite3 +universal

zsh: command not found: port Duhhh... it fails because I dont have macports on my machine

So I did

brew install sqlite3 +universal

To verify that sqlite3 worked I did

sqlite3 -version
3.7.12 2012-04-03 19:43:07 86b8481be7e76cccc92d14ce762d21bfb69504af

Now that sqlite3 is installed I re-attempted my git push heroku master and I still get the same error messages. Any tips would be appreciated.

Gemfile

source 'https://rubygems.org'
ruby '2.0.0'
#ruby-gemset=railstutorial_rails_4_0

    gem 'rails', '4.0.0'
    gem 'sqlite3', '1.3.8'

    group :development do
      gem 'sqlite3', '1.3.8'
    end

    gem 'sass-rails', '4.0.0'
    gem 'uglifier', '2.1.1'
    gem 'coffee-rails', '4.0.0'
    gem 'jquery-rails', '3.0.4'
    gem 'turbolinks', '1.1.1'
    gem 'jbuilder', '1.0.2'

    group :doc do
      gem 'sdoc', '0.3.20', require: false
    end

    group :production do
      gem 'pg', '0.15.1'
      gem 'rails_12factor', '0.0.2'
    end

Upvotes: 1

Views: 1177

Answers (2)

Peter Goldstein
Peter Goldstein

Reputation: 4545

The error is occurring on the Heroku environment side, not on your local machine.

Remove this line

gem 'sqlite3', '1.3.8'

from the Gemfile, leaving only the sqlite3 reference in the development group block. Do a bundle update, commit, and push.

Sqlite is not available in the Heroku environment (and you don't need it, since you'll be using Postgres).

Upvotes: 0

jvperrin
jvperrin

Reputation: 3368

You should remove the line gem 'sqlite3', '1.3.8' that is outside the development group of your Gemfile. and move the sqlite3 reference that is in the development group to include the test group as well:

group :development, :test do
  gem 'sqlite3', '1.3.8'
end

The problem is that heroku uses PostgreSQL, and when you deploy, it is trying to use the sqlite3 gem since it is outside of the development group as well as inside of it.

Upvotes: 1

Related Questions