PostgreSQL gem pg was unable to install
I got the same error on Centos. By googling I found two commands to use:
yum install postgresql-libs
-- It gave me message saying, its already installed.yum install postgresql-devel
-- It solved my error related topg_config
for installing the 'pg' .gem.
Hope it helps :)
apos wrote: on Ubuntu 14.04 install:
apt-get install postgresql-server-dev-9.3 libpq-dev
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.
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
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
Windows: Installing pg gem fail with Can't find the PostgreSQL client library (libpq) and undefined reference to `PQconnectdb'
The issue was apparently being caused because I was using the 32 bit version of Ruby. Installed the 64 bit and the issue was resolved.
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
Related Topics
Uninstall Ruby Version from Rbenv
How to Check What Is Queued in Activejob Using Rspec
How to Get an Array with Column Names of a Table
How to Get Request's Target Controller and Action with Rails 3
MAC Os X Mountain Lion "Rails Is Not Currently Installed on This System."
Strange Activerecord::Associationtypemismatch
Using Polymorphic Paths with Nested Associations
How to Use an Overridden Constant in an Inheritanced Class
Ruby Singleton Methods for Class and Objects
Ruby Remove Empty Lines from String
How to Check If a Variable Is an Instance of a Class
Rails: Logging for Code in the Lib Directory
How to Add Two Weeks to Time.Now