检测到Heroku不支持的sqlite3 gem

时间:2022-10-18 20:37:59

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!

有想法该怎么解决这个吗?任何帮助深表感谢!

4 个解决方案

#1


19  

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忽略了特定于开发的宝石,因此在运行bundle时它包含sqlite3 gem。

#2


28  

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进行更改。

#3


0  

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

#4


-1  

Try this

尝试这个

heroku rake db:reset
heroku rake db:migrate

#1


19  

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忽略了特定于开发的宝石,因此在运行bundle时它包含sqlite3 gem。

#2


28  

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进行更改。

#3


0  

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

#4


-1  

Try this

尝试这个

heroku rake db:reset
heroku rake db:migrate