1

I haven't been able to push my Ruby on Rails app to Heroku because it keeps trying to install sqlite3, and Heroku only uses Postgresql. I've followed the instructions of these posts:

Deploying RoR app to Heroku with Sqlite3 fails

Can't push to heroku - sqlite3.h is missing

Setting my sqlite3 gem to only be used in the development and test group, and making sure other gems aren't dependent on it, and making sure I do a git commit beforehand. It still gives me the same "sqlite3.h is missing" error. The one thing I've noticed is that when I run the "gem dependency" command I found a few gems that were dependent on sqlite3 in the development phase, which I thought was ok, but maybe it isn't. I can't find where those gems are being installed though. They are:

Gem acts-as-taggable-on-2.3.3

Gem client_side_validations-3.2.1

Gem cucumber-rails-1.3.0

Gem factory_girl-4.1.0

Gem fixture_builder-0.3.4

Gem kaminari-0.14.1

Gem orm_adapter-0.4.0

And each lists something like "sqlite3 (>= 0, development)" as a dependency. Anyone have any ideas?

--EDIT--

Here's my gem file:

source 'https://rubygems.org'
gem 'rails', '3.2.11'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
#group :development, :test do
#   gem 'sqlite3'
#end
group :production do
  gem 'thin'
  gem 'pg'
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'
#gem 'devise'
# #gem 'omniauth'
gem 'omniauth-facebook'
Community
  • 1
  • 1
bschreck
  • 724
  • 7
  • 18

2 Answers2

4

I figured it out. I was working off a different branch than the master, but pushing the master. Once I changed that it worked. Thanks everyone for helping!

bschreck
  • 724
  • 7
  • 18
  • Glad you were able to sort out your own problem. Please accept this as the answer for the reference of others. – Paul Fioravanti Jan 25 '13 at 08:18
  • I understand the concept of what youre saying but I dont know how that relates to actually solving his problem. I dont think I am working in any branches. Can you provide a little more detail? – Jeff Aug 27 '13 at 01:49
3

try this, use sqlite3 in ur development and test, but pg on production

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

group :production do
        gem 'thin'
    gem 'pg'
end
Nich
  • 1,112
  • 1
  • 14
  • 29
  • Thanks, that was the first thing I tried actually, according to a different post on stack overflow. Didn't work – bschreck Jan 23 '13 at 15:01
  • so what error come out ? I think with this piece of code, it should able to install the PG in the production server. – Nich Jan 23 '13 at 15:53
  • The error is the same I got before: `Installing sqlite3 (1.3.7) 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.` – bschreck Jan 23 '13 at 16:40
  • do you push the latest code to the heroku again? cz i see your gemfile is already exclude the sqlite3, there should nt install sqlite again. – Nich Jan 23 '13 at 16:52
  • Yes, and that's why I don't understand why it's not working. I tried pushing it like 20 times. Is it possible that old git commits are being included in the new one I'm sending? – bschreck Jan 23 '13 at 16:57