【发布时间】:2011-10-18 04:12:41
【问题描述】:
我在部署一个简单的 rails3.1 应用程序时遇到了很多麻烦。似乎有两个主要问题。
- 由于资产管道,资产未加载到生产环境中。
- 我使用默认的 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
【问题讨论】:
标签: ruby-on-rails deployment heroku asset-pipeline