Problems While Deploying Ruby on Rails App on Heroku

Ok this was the second day and it was no less cumbersome than the previous one, tried deploying the app on Heroku and that turned out to be a big headache. so it turns out that heroku doesn’t supports sqlite3. One way of solving this problem is to put sqlite3 in development mode in your Gemfile==> bundle install(again)==> add Gemfile using git and then run git push heroku master.

so if you are facing the following error

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:
Gem files will remain installed in /tmp/build_26udn5p5vbb5b/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.6 for inspection.
Results logged to /tmp/build_26udn5p5vbb5b/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.
! Detected sqlite3 gem which is not supported on Heroku.
! Heroku push rejected, failed to compile Ruby/rails app To! [remote rejected] master -> master (pre-receive hook declined)error: failed to push some refs to ''





source ''

gem 'rails', '3.2.7'

group :development do
 gem 'sqlite3', '1.3.5'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
 gem 'sass-rails', '3.2.4'
 gem 'coffee-rails', '3.2.2'

gem 'uglifier', '1.2.3'

gem 'jquery-rails', '2.0.2'

*courtesy Ruby on Rails Tutorial Book by M. Hartl 

copy the above source code from listing 1.5 in the book and probably you will have to change your rails version and sqlite3 version to your current installed version for me it was rails-3.2.8 and sqlite3-1.3.6. After changing this do the following

$ bundle install

$ git add Gemfile

$ git commit -m "Put Sqlite3 into development in the Gemfile"

$ git push heroku master


And I believe this will finally solve all your problem


One thought on “Problems While Deploying Ruby on Rails App on Heroku

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s