1

I'm trying to install the pg gem.

bens-macbook-pro:liferecord ben$ bundle config build.pg --with-pg-config=/users/ben/postgresql/bin bens-macbook-pro:liferecord ben$ bundle install 

I get this error:

Installing pg (0.10.1) with native extensions /Users/ben/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems/installer.rb:483:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) /Users/ben/.rvm/rubies/ruby-1.9.2-p0/bin/ruby extconf.rb --with-pg-config=/users/ben/postgresql/bin Using config values from /users/ben/postgresql/bin *** 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=/Users/ben/.rvm/rubies/ruby-1.9.2-p0/bin/ruby --with-pg --without-pg --with-pg-dir --without-pg-dir --with-pg-include --without-pg-include=${pg-dir}/include --with-pg-lib --without-pg-lib=${pg-dir}/lib --with-pg-config extconf.rb:13:in ``': Permission denied - /users/ben/postgresql/bin --includedir (Errno::EACCES) from extconf.rb:13:in `<main>' 

What is causing this error?

Extra info:

I installed PostgreSQL from the one click installer.

Here is the output of the directory that I point to for pg-config:

bens-macbook-pro:bin ben$ ls clusterdb droplang pg_archivecleanup pg_dumpall pgbench postmaster createdb dropuser pg_config pg_resetxlog pltcl_delmod psql createlang ecpg pg_controldata pg_restore pltcl_listmod reindexdb createuser initdb pg_ctl pg_standby pltcl_loadmod vacuumdb dropdb oid2name pg_dump pg_upgrade postgres vacuumlo 

I'm running:

Rails 3.0.1 Ruby 1.9.2 OSX 10.6.6 

1 Answer 1

4

In case anyone else has this problem, the error was caused by this:

bundle config build.pg --with-pg-config=/users/ben/postgresql/bin 

It should be

bundle config build.pg --with-pg-config=/users/ben/postgresql/bin/pg_config 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.