2014-06-13 14 views
0

我一直在閱讀有關這個​​問題,我正在試驗,我試過所有可能的解決方案可以想到的,但我無法解決它呢。正如話題所說:我有一個使用SQLite3的Ruby 1.9.3應用程序,但在生產環境(Heroku)中應該使用PostgreSQL,並且我無法從一個切換到另一個。如何將我的應用程序從SQLite3切換到PostgreSQL以在Heroku中運行?

所以,我需要知道我在做什麼錯:(

  • 這是寫在我的配置/ database.rb文件:

配置/ database.rb:

case Padrino.env 
    when :development then DataMapper.setup(:default, "sqlite3://" + Padrino.root('db', "camilo_development.db")) 
    when :test  then DataMapper.setup(:default, "sqlite3::memory:") 
    when :travis  then DataMapper.setup(:default, "sqlite3::memory:") 
    when :staging  then DataMapper.setup(:default, ENV['DATABASE_URL']) 
    when :production then DataMapper.setup(:default, ENV['DATABASE_URL']) 
end 
  • 這是寫在的Gemfile:​​

  • 當我執行Bundle install命令時,輸出結果爲:「您的捆綁包已完成!在組分期及生產寶石沒有安裝「

  • 隨意看到我的倉庫,如果你需要看到具體的東西,我忘了提及:https://github.com/prieser/camilo

非常感謝球員,問候, Prieser

回答

0

在某些時候你必須做好

bundle install --without staging production 

和包配置remem不會加載舞臺或製作寶石。您可以通過這種方式刪除--without條件

bundle config --delete without 

然後再次運行軟件包安裝。

Cheers Steve

相關問題