Cloud9 postgres

后端 未结 7 1778
我在风中等你
我在风中等你 2020-12-01 03:49

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

7条回答
  •  生来不讨喜
    2020-12-01 04:31

    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.

    Solution

    $ 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.

提交回复
热议问题