Error Installing Pg Gem on Osx

Impossible to Install PG gem on my mac with Mavericks

If you want to avoid using MacPorts, you can download the Postgres App and place it into the Application directory.

Then, specify the location of newly downloaded pg_config:

gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/latest/bin/pg_config

If you run in to missing headers problem, try specifying the include directory of the app:

gem install pg -- --with-pg-include='/Applications/Postgres.app/Contents/Versions/latest/include/'

Cannot install PG gem on Mac OSX

First, you should update your Xcode Tools since you are on MacOS. Here is a good post on that: Installing PG gem on OS X - failure to build native extension

Then, I would go ahead and get a fresh instance of Postgres installed via Homebrew. First, uninstall it

brew uninstall postgresql

I would say run brew update, but the link I mentioned has you updating Homebrew. Now reinstall postgres with

brew install postgresql

Rails: Installing PG gem on OS X - failure to build native extension

Same error for me and I didn't experience it until I downloaded OS X 10.9 (Mavericks). Sigh, another OS upgrade headache.

Here's how I fixed it (with homebrew):

  • Install another build of Xcode Tools (typing brew update in the terminal will prompt you to update the Xcode build tools)
  • brew update
  • brew install postgresql

After that gem install pg worked for me.

gem install pg fails on OSX 10.9

I just had this same problem today and this answer solved it for me.

https://stackoverflow.com/a/19620569/91970

Hope that helps.

Summary

brew update

brew install postgresql

bundle install

Error installing pg gem

Got this thing figured out.

Since I had PostgreSQL.app already installed. Gave following command -

gem install pg -- --with-pg-config=/Applications/Postgres93.app/Contents/MacOS/bin/pg_config

Cannot install pg gem in Mavericks with Postgres.app

You probably have the wrong path for --with-pg-config, check if it's actually there.

You can find the correct path to pg_config with:

find /Applications -name pg_config

In the latest Postgres.app Version the path is:

gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.5/bin/pg_config

gem install pg not working on Mac El Capitan

This worked for me:

sudo gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.4/bin/pg_config

Remember to change 9.4 to your postgres version, if different from 9.4.

Error with installing pg gem. OS X 10.10.2

Looks like I found a similar problem from 3 years ago. The installer can't find some of the config files it's looking for. This might work for you.

bundle config build.pg --with-pg-config=/usr/pgsql-9.1/bin/pg_config

If you're on MacPorts try this:

bundle config build.pg --with-pg-config=/opt/local/lib/postgresql91/bin/pg_config

However if you're using brew you can just run

brew install postgresql

gem install pg --with-pg-config works, bundle fails



Related Topics



Leave a reply



Submit