Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Instalar o PostgreSQL
- 1) Sacar Installer version Version 9.4.5 (http://www.enterprisedb.com/products-services-training/pgdownload)
- 2) Instalar:
- -Next
- -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)
- -Escolher o caminho para a data (ex.:C:\Program Files\PostgreSQL\9.4\data)
- -Escolher password "postgres".
- -Deixar a porta default : 5432
- -Deixar default locale
- -Next
- -Não instalar o Launch Stack Builder e clicar Finish.
- 3) Definir as variaveis de ambiente no Path :
- ex.: C:\Program Files\PostgreSQL\9.4\bin e C:\Program Files\PostgreSQL\9.4\lib
- 4) Iniciar o pgAdmin III e clicar na PostgreSQL 9.4 (localhost 5432) duas vezes.
- - Por a password "postgres".
- 5)Abrir a consola e correr:
- ->gem install pg
- ->rails new blog -d postgresql (para criar um projecto novo)
- ->bundle config build.pg --with-pg-config=C:\Program Files\PostgreSQL\9.4\bin\pg_config.exe
- 6)Abrir o database.yml dentro da pasta config do protejo e alterar o "development","test","production" para:
- development:
- adapter: postgresql
- database: ldso_db
- username: postgres
- password: postgres
- host: localhost
- encoding: UTF8
- test:
- adapter: postgresql
- database: ldso_db
- username: postgres
- password: postgres
- host: localhost
- encoding: UTF8
- production:
- adapter: postgresql
- database: ldso_db
- username: postgres
- password: postgres
- host: localhost
- encoding: UTF8
- ->rails server
- Bibliografia:
- https://netpie.wordpress.com/2011/03/17/setting-up-rails-3-with-postgresql-on-windows/
- https://c.kat.pe/installing-postgresql-and-the-postgresql-ruby-gem-for-windows-linux-and-mac-os-x#.Vii61PmrShf
- https://www.youtube.com/watch?v=qd6WF32-fm0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement