Anders
Anders

Reputation: 2941

Rails 4 - Heroku Sqlite3 error

I'm having some trouble with Herouku. I can't push because of the following error:

Gem files will remain installed in  /tmp/build_2jdec30lsc3bu/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.7 for inspection.
       Results logged to /tmp/build_2jdec30lsc3bu/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.7/ext/sqlite3/gem_make.out
       An error occurred while installing sqlite3 (1.3.7), and Bundler cannot continue.
       Make sure that `gem install sqlite3 -v '1.3.7'` succeeds before bundling.
 !
 !     Failed to install gems via Bundler.
 !     
 !     Detected sqlite3 gem which is not supported on Heroku.
 !     https://devcenter.heroku.com/articles/sqlite3
 !

 !     Push rejected, failed to compile Ruby/Rails app

And I can't solve it.

I have tried the following:

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

group :production do
  gem 'pg'
end

And I keep getting the same error. I have even tried to remove sqlite3 completely. Same annoying error. I made sure to push my changes before running git push heroku master. Any ideas? Or I will probably give up on Heroku...

Upvotes: 0

Views: 1687

Answers (2)

徐啟倫
徐啟倫

Reputation: 19

How about this?

heroku rake db:reset
heroku rake db:migrate

Upvotes: 0

Rajiv Bakulesh Shah
Rajiv Bakulesh Shah

Reputation: 122

I've had similar problems before. This works for me in my Gemfile:

gem 'sqlite3', group: [:development, :test]
gem 'pg', group: [:production]

Also, in your local git checkout, execute the command heroku config. Confirm that the output has the following environment variables set:

RACK_ENV:                     production
RAILS_ENV:                    production

Give that a shot. Does it work for you?

Upvotes: 2

Related Questions