我无法使用sqlite

时间:2017-06-05 23:43:38

标签: ruby-on-rails-3 heroku sqlite

我正在关注this tutorial创建Ruby on Rail应用程序,我遇到了障碍。我正在尝试将其数据库迁移到Heroku,只是被告知:

c:\Sites\railsbridge\test_app>heroku run rails db:migrate
Running rails db:migrate on floating-ocean-40882... up, run.5709 (Free)
rails aborted!
Gem::LoadError: Specified 'sqlite3' for database adapter, but the gem is not 
loaded. Add `gem 'sqlite3'` to your Gemfile (and ensure its version is at the 
minimum required by ActiveRecord).

已经在我的Gemfile中列出了sqlite3,我做错了什么?

2 个答案:

答案 0 :(得分:3)

Heroku不支持sqlite,建议使用postgresql进行生产

请查看以下帖子

Heroku deployment failed because of sqlite3 gem error

Deploying RoR app to Heroku with Sqlite3 fails

您可以使用Postgresql进行制作,更改应该很简单。只需在Gemfile中更改gem并在database.yml中进行更改即可。

答案 1 :(得分:0)

  

Heroku不支持SQLite它只支持PostgresSQL这里是完整的documentation用于在Heroku上部署