PG :: ConnectionBad:无法连接到服务器:当我运行heroku时,没有这样的文件或目录运行rake db:migrate

时间:2020-07-29 11:19:14

标签: ruby-on-rails postgresql heroku activerecord rubygems

我正在Windows中运行Postgres 12.3。

获取错误:

E:\ ruby​​ \ basic_auth> heroku运行rake db:migrate »警告:heroku更新从7.39.2到7.42.5。 正在运行的rake db:在⬢rocky-ravine-69290上迁移... up,run.6606(免费) 耙子流产了! PG :: ConnectionBad:无法连接到服务器:没有这样的文件或目录 服务器是否在本地运行并接受 Unix域套接字“ /var/run/postgresql/.s.PGSQL.5432”上连接? /app/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in initialize' /app/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in new' /app/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in connect' /app/vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.3.2/lib/active_record/connection_adapters/postgresql_adapter.rb:46:in postgresql_connection' /app/vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:887:in new_connection' /app/vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:931:in checkout_new_connection' /app/vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:910:in try_to_checkout_new_connection' /app/vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:871:in acquire_connection' /app/vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:593:in checkout' /app/vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:437:in connection' /app/vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:1119:in retrieve_connection' /app/vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.3.2/lib/active_record/connection_handling.rb:221:in retrieve_connection' /app/vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.3.2/lib/active_record/connection_handling.rb:189:in connection' /app/vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.3.2/lib/active_record/tasks/database_tasks.rb:238:in migrate' /app/vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.3.2/lib/active_record/railties/databases.rake:86:in block (3 levels) in <main>' /app/vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.3.2/lib/active_record/railties/databases.rake:84:in in' /app/vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.3.2/lib/active_record/railties/databases.rake:84:in block (2 levels) in <main>' /app/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/exe/rake:27:in ' /app/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:74:in load' /app/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:74:in kernel_load' /app/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:28:in run' /app/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/cli.rb:463:in exec' /app/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in run' /app/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in invoke_command' /app/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor.rb:387:in dispatch' /app/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/cli.rb:27:in dispatch' /app/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/base.rb:466:in start' /app/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/cli.rb:18:in 开始 /app/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/exe/bundle:30:in block in <top (required)>' /app/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/friendly_errors.rb:124:in with_friendly_errors' /app/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/exe/bundle:22:in <top (required)>' /app/bin/bundle:104:in load' / app / bin / bundle:104:in'' 任务:TOP => db:migrate (通过使用--trace运行任务来查看完整的跟踪信息)

需要帮助,为什么会出现此错误以及如何将其删除?

0 个答案:

没有答案