[英]Detected sqlite3 gem which is not supported on Heroku
I'm trying to push my rails app to Heroku, and I keep getting the following error:我正在尝试将我的 rails 应用程序推送到 Heroku,但我不断收到以下错误:
An error occurred while installing sqlite3 (1.3.8), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.8'` 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 app
Here is what my gemfile looks like:这是我的 gemfile 的样子:
group :devlopment, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
end
Any ideas on how to fix this?有想法该怎么解决这个吗? Any help is much appreciated!任何帮助深表感谢!
I have modified the gem file to use sqlite only on development, and test.我已将 gem 文件修改为仅在开发和测试中使用 sqlite。
But, my mistake was: I have forgotten to commit the changes on git.但是,我的错误是:我忘记在 git 上提交更改。
You have a typo:你有一个错字:
group :development, :test do # <<<< :development, not devlopment
gem 'sqlite3'
end
As heroku ignores development specific gems, when running the bundle it includes sqlite3 gem.由于 heroku 忽略特定于开发的 gem,因此在运行包时它包含 sqlite3 gem。
Try using this for production尝试将其用于生产
group :production do
gem 'pg', '0.15.1'
gem 'rails_12factor'
end
Additional information can be found here: https://devcenter.heroku.com/articles/sqlite3可以在此处找到其他信息: https : //devcenter.heroku.com/articles/sqlite3
For me I solve this issue by replacing gem 'sqlite3'
with gem "pg"
in the gemfile对我来说,我通过在 gemfile 中用gem "pg"
替换gem 'sqlite3'
解决这个问题
and then ofcourse heroku restart
and heroku rake db:migrate
然后当然heroku restart
和heroku rake db:migrate
Try this试试这个
heroku rake db:reset
heroku rake db:migrate
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.