Last active
August 29, 2015 14:23
-
-
Save dcousette/d1bf652515442d3d2754 to your computer and use it in GitHub Desktop.
Getting Postgres to work with Rails in Cloud 9 IDE
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
Setup ruby environment | |
use rvm to get to ruby 2.1.1 | |
postgres was installed on cloud 9 - but need to create a user and password | |
followed blog post on this http://www.gotealeaf.com/blog/how-to-install-postgres-for-linux | |
w/ a few notes... | |
sudo sudo -u postgres psql (to get to postgres CL in cloud9) | |
postgres=# CREATE ROLE <your_username> WITH CREATEDB LOGIN PASSWORD <your_password>; | |
(note .. password needed to be a 'string' and remember the semicolon at end;) | |
Then ran into an error with "template1" ??? | |
fixed template error by adding template: template0 to my database.yml file | |
----------------------------------- | |
config/database.yml | |
development: | |
adapter: postgresql | |
encoding: unicode | |
database: myflix_development | |
host: localhost | |
pool: 5 | |
username: dcousette | |
password: niven | |
template: template0 | |
test: | |
adapter: postgresql | |
encoding: unicode | |
database: myflix_test | |
host: localhost | |
pool: 5 | |
username: dcousette | |
password: niven | |
template: template0 | |
Then create databases by running -- rake db:create:all | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment