Skip to content

Instantly share code, notes, and snippets.

@dcousette
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcousette/d1bf652515442d3d2754 to your computer and use it in GitHub Desktop.
Save dcousette/d1bf652515442d3d2754 to your computer and use it in GitHub Desktop.
Getting Postgres to work with Rails in Cloud 9 IDE
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