2011-12-21 217 views
4

對於Rails 3.1應用程序,我想在本地使用SQLite進行開發並部署到Heroku(需要PostgreSQL)。如何在本地安裝PostgreSQL的情況下部署到Heroku?

我建立了我的Gemfile與

 
group :development, :test do 
    gem 'sqlite3' 
end 

我可以推到Heroku的成功,但應用程序失敗,

 
"Please install the postgresql adapter: `gem install activerecord-postgresql-adapter` (pg is not part of the bundle. Add it to Gemfile.)" 

如果我添加了PG寶石我的Gemfile並運行安裝包,我得到:

 
"ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)  /opt/local/bin/ruby extconf.rb checking for pg_config . . . not found" 

因爲我沒有在本地安裝PostgreSQL。

我不想在本地安裝PostgreSQL。

有沒有辦法在本地安裝PostgreSQL的情況下部署到Heroku?

+0

好建議一般,但在這種情況下,我做的事情很簡單,不值得用一個未使用的包塞滿我的機器。 – 2011-12-21 18:30:30

回答

7
bundle install --without production 

應該這樣做。有關更多信息,請參見docs

相關問題