在heroku部署之后迁移时出现sqlite错误

时间:2016-09-15 09:30:43

标签: ruby-on-rails sqlite heroku database-migration rails-postgresql

所以我将我的应用程序部署到Heroku并安装了gem' pg'并删除了sqlite。 我在本地或Heroku上迁移时出现此错误

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).

我该如何解决这个问题?感谢

1 个答案:

答案 0 :(得分:1)

在开发中添加"sqlite3",在"pg"

中添加production
group :development, :test do
  gem 'sqlite3'
end

group :production do
  gem 'pg'
end