简体   繁体   English

检测到 Heroku 不支持的 sqlite3 gem

[英]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 restartheroku rake db:migrate

Try this试试这个

heroku rake db:reset
heroku rake db:migrate

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 检测到 Heroku 不支持的 sqlite3 gem。 但它不在 Gemfile 上 - Detected sqlite3 gem which is not supported on Heroku. But it is not on the Gemfile Rails 4-删除了sqlite3宝石-“ Heroku不支持检测到的sqlite3宝石” - Rails 4 - Removed sqlite3 gem - “Detected sqlite3 gem which is not supported on Heroku” 检测到Heroku不支持的sqlite3 gem:我的项目中没有sqlite3 - Detected sqlite3 gem which is not supported on Heroku: nowhere is sqlite3 in my project Heroku Push错误“ Heroku不支持检测到的sqlite3 gem。” - Heroku Push error “Detected sqlite3 gem which is not supported on Heroku.” 检测到Heroku不支持的sqlite3 gem-尝试了其他解决方案但无济于事 - Detected sqlite3 gem which is not supported on Heroku — tried other solutions but to no avail heroku rails使用Elasticsearch Gem :: LoadError sqlite3问题 - heroku rails use Elasticsearch Gem::LoadError sqlite3 issue Heroku构建错误:为数据库适配器指定了“ sqlite3”,但未加载gem - Heroku build error: Specified 'sqlite3' for database adapter, but the gem is not loaded 由于sqlite3 gem错误,Heroku部署失败 - Heroku deployment failed because of sqlite3 gem error 如何使用 SQLite3 gem 将 Rails 应用程序部署到 Heroku - How to deploy a Rails application with SQLite3 gem to Heroku Heroku为数据库适配器提供了“指定的&#39;sqlite3&#39;,但未加载gem” - Heroku is giving 'Specified 'sqlite3' for database adapter, but the gem is not loaded'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM