rake db:migrate fail~> PG :: ConnectionBad:无法连接到服务器:连接被拒绝

时间:2015-04-06 16:11:49

标签: postgresql ruby-on-rails-4 rake dbmigrate

当我尝试

时,有人可以帮助我解决错误
rake db:migrate

使用ubuntu 14

这是随后的错误

rake aborted!
PG::ConnectionBad: could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
/home/simplybel/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `initialize'
/home/simplybel/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `new'
/home/simplybel/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `connect'
/home/simplybel/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:242:in `initialize'
/home/simplybel/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `new'
/home/simplybel/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `postgresql_connection'
/home/simplybel/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:436:in `new_connection'
/home/simplybel/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:446:in `checkout_new_connection'
/home/simplybel/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection'
/home/simplybel/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout'
/home/simplybel/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout'
/home/simplybel/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `block in connection'
/home/simplybel/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection'
/home/simplybel/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:565:in `retrieve_connection'
/home/simplybel/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
/home/simplybel/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/connection_handling.rb:87:in `connection'
/home/simplybel/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/migration.rb:913:in `initialize'
/home/simplybel/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/migration.rb:820:in `new'
/home/simplybel/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/migration.rb:820:in `up'
/home/simplybel/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/migration.rb:798:in `migrate'
/home/simplybel/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
/home/simplybel/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

任何头盔都会这样做,因为我正在尝试更新数据库,只是做了一个新的克隆和捆绑安装到我的目录中试试看,这就是它在我尝试做的时显示的

rake db:migrate

我不知道为什么,但任何帮助都会做,谢谢

0 个答案:

没有答案