Advertisement
lewis_FEUP

Instalar postgresql no rails

Oct 22nd, 2015
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. Instalar o PostgreSQL
  2. 1) Sacar Installer version Version 9.4.5 (http://www.enterprisedb.com/products-services-training/pgdownload)
  3. 2) Instalar:
  4. -Next
  5. -Escolher caminho se possível sem espaços porque pode dar um erro (mas no meu não deu ex.: C:\Program Files\PostgreSQL\9.4)
  6. -Escolher o caminho para a data (ex.:C:\Program Files\PostgreSQL\9.4\data)
  7. -Escolher password "postgres".
  8. -Deixar a porta default : 5432
  9. -Deixar default locale
  10. -Next
  11. -Não instalar o Launch Stack Builder e clicar Finish.
  12. 3) Definir as variaveis de ambiente no Path :
  13. ex.: C:\Program Files\PostgreSQL\9.4\bin e C:\Program Files\PostgreSQL\9.4\lib
  14. 4) Iniciar o pgAdmin III e clicar na PostgreSQL 9.4 (localhost 5432) duas vezes.
  15. - Por a password "postgres".
  16. 5)Abrir a consola e correr:
  17. ->gem install pg
  18. ->rails new blog -d postgresql (para criar um projecto novo)
  19. ->bundle config build.pg --with-pg-config=C:\Program Files\PostgreSQL\9.4\bin\pg_config.exe
  20. 6)Abrir o database.yml dentro da pasta config do protejo e alterar o "development","test","production" para:
  21.  
  22. development:
  23. adapter: postgresql
  24. database: ldso_db
  25. username: postgres
  26. password: postgres
  27. host: localhost
  28. encoding: UTF8
  29.  
  30. test:
  31. adapter: postgresql
  32. database: ldso_db
  33. username: postgres
  34. password: postgres
  35. host: localhost
  36. encoding: UTF8
  37.  
  38. production:
  39. adapter: postgresql
  40. database: ldso_db
  41. username: postgres
  42. password: postgres
  43. host: localhost
  44. encoding: UTF8
  45.  
  46. ->rails server
  47.  
  48. Bibliografia:
  49. https://netpie.wordpress.com/2011/03/17/setting-up-rails-3-with-postgresql-on-windows/
  50. https://c.kat.pe/installing-postgresql-and-the-postgresql-ruby-gem-for-windows-linux-and-mac-os-x#.Vii61PmrShf
  51. https://www.youtube.com/watch?v=qd6WF32-fm0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement