Skip to content

Instantly share code, notes, and snippets.

@mikesjewett
Created October 11, 2012 13:43
Show Gist options
  • Save mikesjewett/3872369 to your computer and use it in GitHub Desktop.
Save mikesjewett/3872369 to your computer and use it in GitHub Desktop.
Postgresql Stuff
rails new <name of app> -d postgresql
rails g scaffold User name:string
rake db:migrate
Install Postgres.app
brew install postgresql
Problem: FATAL: role "<name of app/db here>" does not exist
Solution:
cd /usr/lib
createuser -s -r postgresql #first time only
createuser -s -r <name of app/db> #example: createuser -s -r codetalk_development
Start PG CLI:
psql -h localhost
CREATE DATABASE your_database_name; (should return "CREATE DATABASE") #example: codetalk_development
@mikesjewett
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment