Heroku does not accept push even though I have sqlite in development block

霸气de小男生 提交于 2019-12-19 05:11:56

问题


I have the following lines in my Gemfile:

gem 'rails', '3.1.1'

group :production do
  gem 'pg'
end        

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

I also ran bundle install to have my Gemfile.lock updated.

When I push to heroku I still get the following error:

 !
 !     Failed to install gems via Bundler.
 !     
 !     Detected sqlite3 gem which is not supported on Heroku.
 !     http://devcenter.heroku.com/articles/how-do-i-use-sqlite3-for-development
 !
 !     Heroku push rejected, failed to compile Ruby/rails app

What am I missing?


回答1:


Hoppla. I made quite a silly mistake here. I was currently working on a branch but I pushed the master branch to Herokum, like I was used to.

So git push heroku master did push an old version of the branch, which did of course not contain my changes to the Gemfile.




回答2:


I had sqlite3 in development block, but I had recently installed mailcatcher, a useful gem to catch sent emails and display them to you in your browser.

mailcatcher has sqlite3 as a dependency. Moving it back where it belongs fixed the problem:

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

If you have this error but are sure you do not include sqlite3 outside of the development mode, look for other gem requiring it.



来源:https://stackoverflow.com/questions/8007297/heroku-does-not-accept-push-even-though-i-have-sqlite-in-development-block

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!