我在 heroku 上运行应用程序时遇到问题。我收到的错误消息是:
“使用本机扩展安装 pg (0.14.0) /Users/blanecordes/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems/installer.rb:483:in `rescue in block在 build_extensions 中:错误:无法构建 gem 原生扩展。(Gem::Installer::ExtensionBuildError)
/Users/blanecordes/.rvm/rubies/ruby-1.9.2-p0/bin/ruby extconf.rb --with-pg-config=/users/blanecordes/postgresql/bin/pg_config 使用来自 /users/blanecordes 的配置值/postgresql/bin/pg_config sh:/users/blanecordes/postgresql/bin/pg_config:没有这样的文件或目录 sh:/users/blanecordes/postgresql/bin/pg_config:没有这样的文件或目录检查 libpq-fe.h。 .. * extconf.rb 失败 *由于某种原因无法创建 Makefile,可能缺少必要的库和/或头文件。检查 mkmf.log 文件以获取更多详细信息。您可能需要配置选项。”
我的宝石文件是:
source 'https://rubygems.org'
gem 'rails', '3.2.3'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
gem 'pg'
gem 'nokogiri'
gem 'pry'
group :test, :development do
gem 'sqlite3'
gem "rspec-rails", "~> 2.0"
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platform => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'