I am trying to set up a postgres database in a Rails app in Cloud9.
I have followed the instructions here: https://docs.c9.io/setting_up_postgresql.html and set up
For me, doing the steps in Cloud9 workspace setup with Rails and Postgresql wasn't enough.
It was passing in my user, but not the password.
echo $USERNAME was coming up with nothing.
$ sudo su - postgres
$ createuser ubuntu -dslP
Then I did this:
sudo sudo -u postgres psql
postgres=# \password
Enter new password: entered a real password
Enter it again: entered it again
postgres=# \q
Then I did this in my yaml file (note I killed the host part):
development:
adapter: postgresql
encoding: unicode
database: my_database_name
pool: 5
username: ubuntu
password: actual_password
Then I was able to create my database with:
rake db:create
And my Rails server started without any more hiccups.