我正在使用 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.
...
接下来我尝试了这里提出的解决方案:
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