Dominic M. Liddell

Assuming that you have Rails and Postgres installed on your workstation, create a new app:


rails new myapp --database=postgresql

In the gemfile from your application directory, ensure that the following line is included


gem 'pg'

Also, ensure that config/database.yml is configured to use the postgresql adapter. You should see code similar to:


default: &default
adapter: postgresql
encoding: unicode
# For details on connection pooling, see Rails configuration guide
# http://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>

Now, run:


rake db:setup

Tagged:

Share this article: http://dominicmliddell.com/ewkzz