我有一个 Ruby on Rails 应用程序,并且刚刚开始将其部署到 Heroku。
Heroku 快速入门指南说要在生产环境中包含用于数据库的 pg gem。好的,这是我上次部署到 Heroku 时出现的,我用以下方法解决了它:
group :production do
gem 'pg'
end
但是,这一次,当我尝试在本地“捆绑安装”或“捆绑更新”我的应用程序时,出于某种原因尝试安装 pg,即使我明确告诉它只在生产中使用 pg!这是什么原因,我能做些什么来解决它?谢谢!
Installing pg (0.13.2) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/user/.rvm/rubies/ruby-1.9.3-p194/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.