我正在尝试将我的应用程序部署到服务器,并且我已经跳过了关于在服务器上安装postgres的步骤,因为我有一个将处理我的数据库的远程服务器。
我正在使用capistrano和独角兽,如果这是相关的,我已经做了尝试和配置它,以便它将理解数据库是远程的:
production:
<<: *default
url: <%= ENV['DATABASE_URL'] %>
我已将DATABASE_URL添加到服务器,格式如下:
postgres://[username]:[password]@aws-eu-west-1-portal.0.dblayer.com:10155/db-table
因此:
export DATABASE_URL="postgres://[username]:[password]@aws-eu-west-1-portal.0.dblayer.com:10155/DB-TABLE"
然而,当我跑
时bin/cap production deploy
我明白了:
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deploy@ip-address: bundle exit status: 5
bundle stdout: An error occurred while installing pg (0.18.1), and Bundler cannot continue.
Make sure that `gem install pg -v '0.18.1'` succeeds before bundling.
bundle stderr: Nothing written
也可能是因为我安装了阻止大多数端口的防火墙,除了这些:
To Action From
-- ------ ----
22 ALLOW Anywhere
80/tcp ALLOW Anywhere
443 ALLOW Anywhere
22 (v6) ALLOW Anywhere (v6)
80/tcp (v6) ALLOW Anywhere (v6)
443 (v6) ALLOW Anywhere (v6)
关于如何使其正常工作的任何想法?