首先,我是一個總Rails/PostgreSQL noob。使用外部postgres數據庫將軌道部署到Heroku
我想部署一個Rails應用程序Heroku。我已經完成並運行了,但每次部署時,Heroku會忽略我的database.yml信息並生成一個新的數據庫。這是我的database.yml
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
#
default: &default
adapter: sqlite3
pool: 5
timeout: 5000
development:
# <<: *default
# database: db/development.sqlite3
adapter: postgresql
pool: 5
host: wwydh.cqqq2sesxkkq.us-east-1.rds.amazonaws.com
timeout: 5000
username: wwydh_a_team
password: really cool password
database: wwydh
host: wwydh.cqqq2sesxkkq.us-east-1.rds.amazonaws.com
port: 5432
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: db/test.sqlite3
我在做什麼錯?
謝謝您的回答!當我運行第一個命令(使用和不使用大括號)時,我得到DATABASE_URL:postgress:// wwydh_a_team:[email protected]:5432/wwydh無效。必須採用FOO = bar格式。 –
更新,我改變了DATABASE_URL:postgres到DATABASE_URL = postgres並且運行了命令,但我得到了「無法覆蓋附件值DATABASE_URL」。 –
對不起':'我更新了回答 –