我想更多PostgreSQL我的品牌新的Rails项目执行rake命令,但我收到此错误:耙中止,无法连接做的PostgreSQL:连接被拒绝
rake aborted! 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?
Tasks: TOP => db:migrate (See full trace by running task with --trace)
real 0m3.245s user 0m1.668s sys 0m0.382s
这是我的第一个Rails应用程序曾经,我WHE运行rails server
这是输出:
=> Booting WEBrick
=> Rails 3.2.3 application starting in development on
http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server [2012-06-19 01:17:30] INFO WEBrick 1.3.1 [2012-06-19 01:17:30] INFO ruby 1.9.3 (2012-04-20)
[x86_64-darwin11.3.0] [2012-06-19 01:17:30] INFO
WEBrick::HTTPServer#start: pid=4668 port=3000
的Rails -v:Rails 3.2.3
宝石ENV:
RubyGems Environment: - RUBYGEMS VERSION: 1.8.24 - RUBY VERSION: 1.9.3 (2012-04-20 patchlevel 194) [x86_64-darwin11.3.0] - INSTALLATION DIRECTORY: /Users/kinhow/.rvm/gems/ruby-1.9.3-p194 - RUBY EXECUTABLE: /Users/kinhow/.rvm/rubies/ruby-1.9.3-p194/bin/ruby - EXECUTABLE DIRECTORY: /Users/kinhow/.rvm/gems/ruby-1.9.3-p194/bin - RUBYGEMS PLATFORMS: - ruby - x86_64-darwin-11 - GEM PATHS: - /Users/kinhow/.rvm/gems/ruby-1.9.3-p194 - /Users/kinhow/.rvm/gems/[email protected] - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :benchmark => false - :backtrace => false - :bulk_threshold => 1000 - REMOTE SOURCES: - http://rubygems.org/
,如果有帮助:
运行psql
psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
试过rake db:先迁移吧? – vajapravin
是的,同样的错误:'拒绝连接' –
给这些命令的输出'rails -v'和'gem env' – vajapravin