Last Updated: February 25, 2016
·
407
· tonyrain

Configure PostgreSQL in Rails 4

First of all you need to add new gem into your Gemfile:

gem 'pg'

Make sure you've started this command:

bundle install

Next, you need to

development:
  adapter: postgresql
  encoding: unicode
  database: HERE_YOUR_DB_NAME
  pool: 5
  username: HERE_YOUR_USER_NAME
  password: HERE_YOUR_USER_PASSWORD

FInally your need to start rake task:

rake db:create:all

Don't forget to run migrations:

rake db:migrate