PG :: ConnectionBad:无法连接到服务器:连接被拒绝

丹尼尔·巴里尔

尝试运行时出现以下错误

git heroku push master

我不怎么解决问题。我正在使用Rails 3.2.19

 fernando@fernando:~/ProyectoTicketMaster/Ticket_Master$ git push  heroku master 

Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       Connecting to database specified by DATABASE_URL
       rake aborted!
       PG::ConnectionBad: 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?
       /tmp/build_dd87fdc88ebb265d09b8212e3b0df10b/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.19/lib/active_record/connection_adapters/postgresql_adapter.rb:1222:in `initialize'
       /tmp/build_dd87fdc88ebb265d09b8212e3b0df10b/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.19/lib/active_record/connection_adapters/postgresql_adapter.rb:1222:in `new'
       /tmp/build_dd87fdc88ebb265d09b8212e3b0df10b/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.19/lib/active_record/connection_adapters/postgresql_adapter.rb:1222:in `connect'

这是我的GemFile。我正在使用pg进行生产,而使用sqlite进行开发。在这里附上我的GemFile和我的databse.yml

source 'https://rubygems.org'

gem 'rails', '3.2.19'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :development, :test do
  gem 'sqlite3',     '1.3.9'

end

group :production do
  gem 'pg',             '0.17.1'
  gem 'rails_12factor', '0.0.2'
end


gem 'hirb'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'


development:
  adapter: sqlite3
  database: db/development.sqlite3
  pool: 5
  timeout: 5000

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  adapter: sqlite3
  database: db/test.sqlite3
  pool: 5
  timeout: 5000

production:
  adapter: sqlite3
  database: db/production.sqlite3
  pool: 5
  timeout: 5000
丹尼尔·巴里尔

在config / application.rb中添加以下行是我的问题的解决方案

 config.assets.initialize_on_precompile = false

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Heroku:PG :: ConnectionBad:无法连接到服务器:连接被拒绝

耙子中止!PG::ConnectionBad: 无法连接到服务器:连接被拒绝

无法连接到服务器:没有这样的文件或目录(PG :: ConnectionBad)

Heroku rake 中止(PG::ConnectionBad:无法连接到服务器:没有这样的文件或目录)

pg_connect():无法连接到PostgreSQL服务器

Rails 在 Mac OS X / PG::ConnectionBad 上找不到我的 Postgres 服务器:无法连接到服务器

pg_dump:[存档(db)]与数据库“开发”的连接失败:无法连接至服务器:连接被拒绝

保留作业时出错:PG :: ConnectionBad:PQconsumeInput()服务器意外关闭了连接

无法在 postgres 复制中执行基本备份。错误:pg_basebackup:无法连接到服务器

pg Admin 4 - 尝试连接到 PostgreSQL 13 服务器时“postgres”用户的密码

PG :: UnableToSend:在Rails中没有与服务器的连接

Golang lib / pg无法连接到Postgres

无法使用“pg” gem 连接到 postgres?

rspec-PG :: UnableToSend:服务器意外关闭了连接,这可能意味着服务器异常终止

PostgreSQL(pg_hba.conf / postgresql.conf)与服务器的连接丢失。尝试重置:失败

PG :: UnableToSend:在Rails 5中没有与服务器的连接

PG::ConnectionBad: FATAL: 生产服务器上用户“postgres”的密码验证失败

Heroku + Rails + PG:ActiveRecord :: StatementInvalid(PG :: ConnectionBad:PQconsumeInput()SSL连接已意外关闭

尝试连接到蓝牙服务器时连接被拒绝

尝试连接到服务器时,Sshutle连接被拒绝

连接到 Web 服务器时连接被拒绝

PG :: ConnectionBad错误

PostgreSQL-django.db.utils.OperationalError:无法连接到服务器:连接被拒绝

tomcat7-无法远程连接到服务器(端口8080:连接被拒绝)

无法连接到Eureka服务器。异常:java.net.ConnectException:连接被拒绝:connect

泊坞窗生成错误:psql:无法连接到服务器:连接被拒绝

无法连接到我的世界远程服务器:连接被拒绝

引导时出现“ psycopg2.OperationalError:无法连接到服务器:连接被拒绝”错误

OperationalError:无法连接到服务器:端口5432上的权限拒绝tTCP / IP连接?