Skip to content

Instantly share code, notes, and snippets.

@captproton
Created October 21, 2010 19:53
Show Gist options
  • Select an option

  • Save captproton/639190 to your computer and use it in GitHub Desktop.

Select an option

Save captproton/639190 to your computer and use it in GitHub Desktop.
error installing pg gem
Installing pg (0.8.0) with native extensions /opt/local/lib/ruby/site_ruby/1.8/rubygems/installer.rb:482:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/opt/local/bin/ruby extconf.rb
extconf.rb:1: command not found: pg_config --version
ERROR: can't find pg_config.
HINT: Make sure pg_config is in your PATH
*** 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.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/opt/local/bin/ruby
Gem files will remain installed in /Users/heathertanner/.bundler/tmp/5188/gems/pg-0.8.0 for inspection.
Results logged to /Users/heathertanner/.bundler/tmp/5188/gems/pg-0.8.0/ext/gem_make.out
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/installer.rb:445:in `each'
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/installer.rb:445:in `build_extensions'
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/installer.rb:197:in `install'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/source.rb:100:in `install'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:55:in `run'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:in `each'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:in `each'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:44:in `run'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:8:in `install'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/cli.rb:217:in `install'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/task.rb:22:in `send'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/task.rb:22:in `run'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/base.rb:389:in `start'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0/bin/bundle:13
from /opt/local/bin/bundle:19:in `load'
from /opt/local/bin/bundle:19
captproton:osskids2 heathertanner$ sudo gem install pg
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/opt/local/bin/ruby extconf.rb
checking for pg_config... no
=========== WARNING ===========
You are building this extension on OS X without setting the
ARCHFLAGS environment variable, and pg_config wasn't found in
your PATH. If you are seeing this message, that means that the
build will probably fail.
If it does, you can correct this by either including the path
to 'pg_config' in your PATH or setting the environment variable
ARCHFLAGS to '-arch <arch>' before building.
For example:
(in bash) $ export PATH=/opt/local/lib/postgresql84/bin:$PATH
$ export ARCHFLAGS='-arch x86_64'
(in tcsh) % set path = ( /opt/local/lib/postgresql84/bin $PATH )
% setenv ARCHFLAGS '-arch x86_64'
Then try building again.
===================================
MacOS X build: fixing architecture flags:
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.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/opt/local/bin/ruby
--with-pg
--without-pg
--with-pg-config
--without-pg-config
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/lib
--enable-static-build
--disable-static-build
Gem files will remain installed in /opt/local/lib/ruby/gems/1.8/gems/pg-0.9.0 for inspection.
Results logged to /opt/local/lib/ruby/gems/1.8/gems/pg-0.9.0/ext/gem_make.out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment