【发布时间】:2012-12-07 19:26:01
【问题描述】:
我正在使用 sqlite3 开发一个 Rails 应用程序。我想把它推到 Heroku。在 Heroku 教程中,它说我必须先更改:
gem 'sqlite3'
到
gem 'pg'
然后运行
bundle install
我收到了这个错误:
Installing pg (0.14.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
...
Can't find the PostgreSQL client library (libpq)
*** 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.
...
接下来我尝试了here提出的解决方案:
running gem install pg -- --with-pg-config= /usr/bin/pg_config
我也试过跑步:
sudo apt-get install postgresql
sudo apt-get install libpq-dev
和
gem install pg
工作正常..
但是
bundle install
仍然给我同样的错误
注意:我使用的是 rvm
【问题讨论】:
-
我认为我使用 rvm 的事实在某种程度上使事情变得复杂,因此 SO 上的解决方案都不起作用......
标签: ruby-on-rails heroku gem bundle