Wykonaj następujące czynności:
-
Utwórz nową nazwę użytkownika i hasło do postgresql na cloud9:
$ sudo service postgresql start $ sudo sudo -u postgres psql postgres=# CREATE USER username SUPERUSER PASSWORD 'password'; postgres=# \q
-
Utwórz zmienne ENV w chmurze9:
$ echo "export USERNAME=username" >> ~/.profile $ echo "export PASSWORD=password" >> ~/.profile $ source ~/.profile
Mój database.yml dla szyn 4.2.0 na cloud9:
default: &default adapter: postgresql encoding: unicode pool: 5 username: <%= ENV['USERNAME'] %> password: <%= ENV['PASSWORD'] %> host: <%= ENV['IP'] %> development: <<: *default database: sample_app_development test: <<: *default database: sample_app_test production: <<: *default database: sample_app_production
-
Dołącz klejnot
pg
w Gemfile i zainstaluj:klejnot 'pg', '~> 0,18.2'
$ bundle install
-
Zaktualizuj szablon1 postgresql dla database.yml na cloud9:
postgres=# UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1'; postgres=# DROP DATABASE template1; postgres=# CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING = 'UNICODE'; postgres=# UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template1'; postgres=# \c template1 postgres=# VACUUM FREEZE; postgres=# \q
-
Z wiersza poleceń uruchom:
bundle exec rake db:create