This repository has been archived by the owner on Dec 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Setup PostgreSQL with Rails
Kaiyu edited this page Feb 13, 2017
·
1 revision
Foreword: this is not a very good guide
- If you are on Mac, follow this RailsCast Video: http://railscasts.com/episodes/342-migrating-to-postgresql?view=asciicast
- If you are on Ubuntu, follow https://help.ubuntu.com/community/PostgreSQL
- Some blogs: https://www.digitalocean.com/community/tutorials/how-to-setup-ruby-on-rails-with-postgres
- Here are several StackOverflow questions that you may need to refer:
- Fatal: role “username” does not exist http://stackoverflow.com/questions/11919391/postgresql-error-fatal-role-username-does-not-exist
-
postgres
is a locked user: http://serverfault.com/questions/110154/whats-the-default-superuser-username-password-for-postgres-after-a-new-install - Cannot create lock file: http://stackoverflow.com/questions/22851352/postgresql-server-failed-to-start-could-not-create-lock-file-permission-denied
How to resolve
Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
when doing rake db:create:all
?
https://www.youtube.com/watch?v=QTCsjVGlPBM
Basically - you need to do $ sudo service postgresql start
FINALLY SUCCEEDED!
- Make sure to create another user
- Config the database.yml with that user's name and password
- rake db:migrate to create schema.rb
- rake db:setup