Created
October 11, 2012 13:43
-
-
Save mikesjewett/3872369 to your computer and use it in GitHub Desktop.
Postgresql Stuff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For creating users in psql:
http://www.cyberciti.biz/faq/howto-add-postgresql-user-account/