我目前通過Railstutorial持續和不斷得到當我運行heroku run rake db:migrate
錯誤運行的Heroku運行耙分貝時:遷移
我已經在網上搜索了幾個小時的錯誤 - 錯誤似乎共同但有沒有一個提出的解決方案似乎有任何區別,你的幫助將非常感謝!
的錯誤是
Connecting to database specified by DATABASE_URL
rake aborted!
Please install the postgresql adapter: `gem install activerecord-postgresql-adapter` (pg is not part of the bundle. Add it to Gemfile.)
我跑gem install activerecord-postgresql-adapter
和改變了我的Gemfile,現在看起來是這樣的:
group :development do
gem 'rspec-rails', '2.6.1'
gem 'sqlite3', '~> 1.3.0'
end
group :test do
gem 'rspec-rails', '2.6.1'
gem 'webrat', '0.7.1'
gem 'sqlite3', '~> 1.3.0'
end
group :production do
gem "pg"
end
犯我跑bundle install --without production
和git push heroku
我的database.yml後看起來像這樣:
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
# 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:
adapter: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 5000
production:
adapter: sqlite3
database: db/production.sqlite3
pool: 5
timeout: 5000
你有什麼你的database.yml文件? – 2013-03-03 17:30:43
在原文中增加了database.yml – 2013-03-03 19:07:49
取出你的gemfile中的生產組,並運行bundle install – 2013-03-03 19:23:40