Can't Install Pg Gem on Rails

Can't install pg gem on Rails

You need to configure pg correctly.

Run:

bundle config build.pg --with-pg-config=/Applications/Postgres.app/Contents/Versions/(YOUR POSTGRES VERSION)/bin/pg_config

Then try to run bundle:

bundle install

Rails pg gem, an error occurred while installing pg

I guess you don't have postgres installed in your system. You could either install postgresql via homebrew/macports or disable the installation of production gems with:

bundle install --without production

Can't install pg gem on Windows

The message you're getting is a clear indication that you lack something for the correct installation of that gem:

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.

There is no Windows native version of latest release of pg (0.10.0) released yesterday, but if you install 0.9.0 it should install binaries without issues.

Anyhow, if you want to install the gem, you need a build environment installed. If you're using RubyInstaller, then you need the DevKit

Installation of the gem will only require you provide additional options to gem installation (like --with-pg-dir)

subst X: "C:\Program Files (x86)\PostgreSQL\8.3"
gem install pg -- --with-pg-dir=X:
subst X: /D

unable to install pg gem

Answered here:
Can't install pg gem on Windows

There is no Windows native version of
latest release of pg (0.10.0) released
yesterday, but if you install 0.9.0 it
should install binaries without
issues.

Bundle install for 'pg' gem endless errors

I think you can find the answer here:
Can't install pg gem on Rails

You should probably install the PostgreSQL development libraries.

If you're on Ubuntu this will help:

sudo apt-get install libpq-dev

On a Mac:

brew install postgresql



Related Topics



Leave a reply



Submit