2014-01-21 34 views
0

我最近將我的測試數據庫從sqlite3切換爲postgrsql。因爲這樣做,當我在這裏按照指示:上部署我的資產的Heroku https://devcenter.heroku.com/articles/rails-asset-pipeline,我得到以下錯誤:數據庫配置在準備資源預編譯時未指定適配器

database configuration does not specify adapter 

這發生在運行這一步

RAILS_ENV=production bundle exec rake assets:precompile 

我試圖按照指示後從這篇文章,它沒有工作。

bundle exec rake assets:precompile - database configuration does not specify adapter

我猜它是與我的database.yml文件,這是這裏

development: 
    adapter: postgresql 
    database: playerpong_database 
    pool: 5 
    timeout: 5000 
    encoding: unicode 
    host: localhost 

任何想法?

回答

2

我想通了。我在我的database.yml文件中添加了一個生產部分。

production: 
    adapter: postgresql 
    database: playerpong_database 
    pool: 5 
    timeout: 5000 
    encoding: unicode 
    host: my_app_url 

我不認爲這是必要的。

1

的問題是,你正在運行

RAILS_ENV=production bundle exec rake assets:precompile 

地方作爲你的文件有發展適配器等錯誤涉及到像適配器缺失。 您需要更改環境的文章,以發展

RAILS_ENV=development bundle exec rake assets:precompile 

或轉變發展指令來生產

production: 
    adapter: postgresql 
    database: playerpong_database 
    pool: 5 
    timeout: 5000 
    encoding: unicode 
    host: localhost 
相關問題