Advertisement
Guest User

Untitled

a guest
Oct 9th, 2016
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1.  
  2. Add a username to your database.yml, might as well use your application's name (or some variant of the name) as the username, I'll use app_name as a placeholder:
  3.  
  4. development:
  5. adapter: postgresql
  6. encoding: utf8
  7. database: app_development
  8. pool: 5
  9. username: app_name
  10. password:
  11. Then create the user (AKA "role") inside PostgreSQL using psql.exe:
  12.  
  13. $ psql -d postgres
  14. postgres=# create role app_name login createdb;
  15. postgres=# \q
  16. The first line is in your terminal, the next two are inside psql. Then do your rake db:create.
  17.  
  18. The User user is possibly a default but user is already taken for other purposes in PostgreSQL so you'd have to quote it to preserve the case if you wanted to use User as a username:
  19.  
  20. postgres=# create role "User" login createdb;
  21. You're better off creating one user per-application anyway.
  22.  
  23. You'll want to do similar things for your test entry in database.yml as well
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement