I'm trying to deploy on heroku a simple blog I created with RoR for learning purposes and sqlite3 is not supported so I decided to migrate to PostgreSQL.
I changed my database.yml file
development:
adapter: postgresql
encoding: utf8
database: blog_development
pool: 5
username: user
password:
test:
adapter: postgresql
encoding: utf8
database: blog_test
pool: 5
username: user
password:
installed PostgreSQL using:
brew install postgresql
removed sqlite3 and added:
gem 'pg'
and ran bundle install
when I tried running:
rake db:create
i got:
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?
I tried fixing it with:
In Rails, Couldn't create database for {"adapter"=>"postgresql",
and:
http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x
http://www.mozmorris.com/2011/11/15/configure-postgresql-to-accept-tcpip-connections.html
Addl. Info:
RoR: 4.0
Ruby: 2.0.0
psql: 9.3.1
pg: '0.17.0'
OS: OSX Mavericks