这是我第一次将rails应用程序部署到生产环境中。我想部署到Fly。IO和已创建的凭据和启动的文件飞行。部署的IO配置文件。但是当我部署时,我得到以下错误:
Starting init (commit: f447594)...
Setting up swapspace version 1, size = 512 MiB (536866816 bytes)
no label, UUID=af164c5a-e60d-4061-98ea-5d4af379bce2
Preparing to run: `bin/rails fly:release` as root
2023/01/01 07:53:05 listening on [fdaa:1:1737:a7b:80:5bf5:b65f:2]:22 (DNS: [fdaa::3]:53)
Is the server running on host "::1" and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.4/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:700:in `checkout_new_connection'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:341:in `checkout'
....
...
...
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-
1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
Tasks: TOP => fly:release => db:migrate
(See full trace by running task with --trace)
Starting clean up.
Error release command failed, deployment aborted
我遵循了来自GoRails的Chris Oliver给出的指示;Deanin,但这没有任何帮助,因为他们可以把它弄起来;只运行几个命令。我相信我的问题在我的配置/数据库/yml文件中,但我能够找出具体细节。
关于我应该如何调试这个问题有什么想法吗?
我注意到这个问题,因为迁移到v2。我通过在飞行中检查一个项目来解决这个问题。toml文件:
- App名称正确(第6行)
一旦我纠正了这个,我遇到了另一个问题。在同一文档中,端口号似乎也需要更新。