0

I'm trying to push my git on heroku. For this i use :

$ git push heroku master

return :

remote:        --without-sqlite3-lib=${sqlite3-dir}/
remote:        
remote:        
remote:        Gem files will remain installed in /tmp/build_ae596310505cf83afbb45a2986208c96/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.11 for inspection.
remote:        Results logged to /tmp/build_ae596310505cf83afbb45a2986208c96/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.11/ext/sqlite3/gem_make.out
remote:        An error occurred while installing sqlite3 (1.3.11), and Bundler cannot
remote:        continue.
remote:        Make sure that `gem install sqlite3 -v '1.3.11'` succeeds before bundling.
remote:  !
remote:  !     Failed to install gems via Bundler.
remote:  !     
remote:  !     Detected sqlite3 gem which is not supported on Heroku.
remote:  !     https://devcenter.heroku.com/articles/sqlite3
remote:  !
remote: 
remote:  !     Push rejected, failed to compile Ruby app
remote: 
remote: Verifying deploy...
remote: 
remote: ! Push rejected to glacial-taiga-8832.
remote: 
To https://git.heroku.com/glacial-taiga-8832.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/glacial-taiga-8832.git'

If i do :

$ sudo gem install sqlite3 -v '1.3.11'

it works but same problem. Anyone can help?

Rubyx
  • 708
  • 1
  • 11
  • 32

1 Answers1

1

You need to move the sqlite3 gem into the development section of your Gemfile. Heroku doesn't have the SQLite database installed.

Example:

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

To use the database on Heroku you need to use PostgreSQL database (by default). To make it work you need to add the pg gem into the production group:

group :production do
  gem 'pg'
end

Also, there are some chances that you will need to update your database.yml, but I believe Heroku will just inject their database connection setting in your config file.

Dmitry Sokurenko
  • 6,042
  • 4
  • 32
  • 53