安装pg(0.18.3)时出错,Bundler无法继续

An error occurred while installing pg (0.18.3) and Bundler cannot continue

我在 bundle install 上的 Rails 项目面临 pg gem 问题,它正在使用 ruby-2.2.2 和 rails (4.2.0) 在 Macbook 上。我收到以下错误: An error occurred while installing pg (0.18.3) and Bundler cannot continue。 谁能协助解决问题?

我通过使用以下命令安装 libpqxx 在我的 Macbook 上解决了这个问题:

brew install libpqxx

在 Ubuntu 上,您可以 运行 下面的命令来解决此问题:

sudo apt-get install libpq-dev