0

I am getting the following error when trying to install 'pg' Any thoughts? I am pretty new to rails so I am not sure how to fix this issue.

Davids-MacBook-Air:~ DavidStevenson$ install pg usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode] [-o owner] file1 file2 install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode] [-o owner] file1 ... fileN directory install -d [-v] [-g group] [-m mode] [-o owner] directory ... Davids-MacBook-Air:~ DavidStevenson$ gem install pg Building native extensions. This could take a while... ERROR: Error installing pg: ERROR: Failed to build gem native extension. /usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby extconf.rb make compiling gvl_wrappers.c compiling pg.c pg.c: In function ‘Init_pg_ext’: pg.c:384: error: ‘PQPING_OK’ undeclared (first use in this function) pg.c:384: error: (Each undeclared identifier is reported only once pg.c:384: error: for each function it appears in.) pg.c:386: error: ‘PQPING_REJECT’ undeclared (first use in this function) pg.c:388: error: ‘PQPING_NO_RESPONSE’ undeclared (first use in this function) pg.c:390: error: ‘PQPING_NO_ATTEMPT’ undeclared (first use in this function) make: *** [pg.o] Error 1 Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.15.1 for inspection. Results logged to /usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.15.1/ext/gem_make.out 

2 Answers 2

1

You probably need to install the postgresql development libraries first, using one of (homebrew, macports, fink). I personally still like macports, but homebrew seems to be growing more popular. If that still doesn't work, you may need to pass some flags to the 'gem install' command to tell it where to find those libraries.

Sign up to request clarification or add additional context in comments.

1 Comment

If my answer worked for you, would you mind marking it as Accepted?
1

please try following link install postgres on Mac :

how to install postgresql for mac os x

Installing Postgresql on Mac Lion

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.