2016-11-21 126 views
0

当我试图将我的Rails数据库从Sqlite更改为Postgres时,遇到了问题。然后,当一切正常时,我决定回到git commit。附:git reset --hard没有帮我用rake db:migrate

git reset --hard 52ca294cd88de9aaa1c00c95e2cdabd744cd7499 

我已经做了bundle install。现在,当我做rake db:migrate我得到这个消息:

rake aborted! Gem::LoadError: Specified 'postgresql' for database adapter, but the gem is not loaded. Add gem 'pg' to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).

我不明白,这一切都承诺在SQLITE3运作良好。谢谢

回答

0

也许你的config/database.yml是不是在你的git仓库检查,并仍然配置postgres。看看这个文件,并将其更改为sqlite。

+0

感谢适配器捆绑做。我在使用pg的其他应用程序中启动了服务器。这是问题,我在这两个应用程序之间感到困惑。 – piga

0

请在您的Gemfile宝石“PG”,然后为你改变,你需要包括皮克宝石PostgreSQL的