Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 部署到数字海洋液滴时出现Postgres错误_Ruby On Rails_Postgresql_Digital Ocean_Capistrano3 - Fatal编程技术网

Ruby on rails 部署到数字海洋液滴时出现Postgres错误

Ruby on rails 部署到数字海洋液滴时出现Postgres错误,ruby-on-rails,postgresql,digital-ocean,capistrano3,Ruby On Rails,Postgresql,Digital Ocean,Capistrano3,我一直在尝试使用Capistrano的cap production deploy将我的应用程序部署到数字海洋水滴时出错。我收到的错误消息是: rake aborted! Gem::LoadError: Specified 'postgresql' for database adapter, but the gem is not loaded. Add `gem 'pg'` to your Gemfile 但我的Gemfile在生产中确实包含pg: 这是什么原因造成的 新发展: 我尝试将db适配

我一直在尝试使用Capistrano的cap production deploy将我的应用程序部署到数字海洋水滴时出错。我收到的错误消息是:

rake aborted!
Gem::LoadError: Specified 'postgresql' for database adapter, but the gem is not loaded.
Add `gem 'pg'` to your Gemfile
但我的Gemfile在生产中确实包含pg:

这是什么原因造成的

新发展: 我尝试将db适配器重置回sqlite3,只是想看看部署是否会成功,但得到了相同的错误:

Gem::LoadError: Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 'sqlite3'` to your Gemfile

对于Win用户来说,这是一个已知的bug。在Gemfile.lock中,更改


我直接在我的回购协议中这样做,因为每次我在本地进行更改并运行bundle安装时,x64标志总是被切换回来

您应该在Gemfile中解决其他问题-我建议您从Gemfile中删除这一行:

gem 'rails_12factor'

rails_12factor是Heroku特有的日志记录宝石,它将对您的Digital Ocean rails服务器造成严重破坏。我可以证明。

您是否已运行bundle安装并提交了Gemfile和Gemfile.lock中的更改?我只能在本地运行它。我尝试在本地创建一个Gemfile,并安装它。我还尝试自行安装pg gem。安装gem时没有问题,但我仍然收到错误消息。我问题的第二部分如何?提交对Gemfile&Gemfile.lock的更改?如果正在部署的代码没有更新的Gemfile.lock,则可能会抛出此错误。@PrakashMurthy您的意思是在本地运行捆绑包?是的。如果您使用的是capistrano,这些步骤将在本地完成。
sqlite3 (1.3.10-x86-mingw32)
sqlite3 (1.3.10-x64-mingw32)
gem 'rails_12factor'