我在部署一個簡單的rails3.1應用程序時遇到了很多麻煩。似乎有兩個主要問題。用rails3.1 heroku部署很多麻煩
- 由於資產管道,資產沒有在生產環境中加載。
- 我使用默認的db sqlite3進行開發。 Heroku使用postgresql。
基本上,我希望我的開發部署工作流盡可能無縫。任何人都可以推薦設置我的開發環境的最佳方式,以便當我$ git push heroku時,一切正常。
我想最好在開發環境中使用postgresql,任何人都知道如何設置這個好帖子?
我應該使用獨角獸嗎?瘦?
我應該使用任何其他寶石,我可能沒有聽說過?
我感到沮喪,因爲我已經到了可以在開發環境中構建非常酷的東西的地步,但卻不知道如何讓應用程序在線。也許我看着這一切都是錯誤的。讓我知道。
當我嘗試這樣做,我得到這個錯誤:
group :production do
gem 'pg'
end
Installing pg (0.11.0) with native extensions /home/work/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:552:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/home/work/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/home/work/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
--with-pg
--without-pg
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/lib
--with-pg-config
--without-pg-config
--with-pg_config
--without-pg_config
呵呵,我認爲它工作。剛剛嘗試了一個新的普通導軌應用程序和導軌標誌現在顯示。現在我要用我的實際應用程序來嘗試。謝謝 –
nope不能用我的實際應用程序,但。只要繼續收到500錯誤頁面 –
如果您的開發機器上的pg gem遇到問題,請閱讀[here](https://bitbucket.org/ged/ruby-pg/wiki/Home) – trogdor33