Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

heroku push fails with the error "An error occurred while installing sqlite3-ruby (1.2.5)"

When I do

git push heroku master

I get the following message:

       An error occurred while installing sqlite3-ruby (1.2.5), and Bundler cannot continue.
       Make sure that `gem install sqlite3-ruby -v '1.2.5'` succeeds before bundling.
 !
 !     Failed to install gems via Bundler.
 !
 !     Heroku push rejected, failed to compile Ruby/rails app

I have libsqlite3-dev, libsqlite3-0, sqlite3 all installed and when i run:

gem install sqlite3-ruby -v '1.2.5'

as suggested in the error message, it successfully installs:

Successfully installed sqlite3-ruby-1.2.5
1 gem installed
Installing ri documentation for sqlite3-ruby-1.2.5...
Installing RDoc documentation for sqlite3-ruby-1.2.5...

I'm not sure what may be the problem.

My Gemfile is:

source 'http://rubygems.org'
gem 'rails', '3.0.1'
gem 'sqlite3-ruby', '1.2.5',:require => 'sqlite3'

May I know what is the problem and how I could solve it?

like image 904
user945216 Avatar asked Feb 22 '26 12:02

user945216


1 Answers

Heroku doesn't support sqlite3.

So you need to change your Gemfile to be:

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

group :production do
  gem 'pg'
end

And run bundle install again

like image 121
Benjamin Tan Wei Hao Avatar answered Feb 25 '26 16:02

Benjamin Tan Wei Hao



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!