gem install pg can not bind to libpq
I've got the same problem in my case was lib's inside .rvm/usr/lib which was taken to this compilation instead of lib's from system. I'm not sure why that happens and why it doesn't work (in my case on Ubuntu 10.04 x86_64) but to solve it just :
mv ~/.rvm/usr/lib ~/.rvm/usr/lib_rvm
for a while or forever ;)
If someone will investigate why that happen I will be appreciate.
Regards.
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
Rails - Gem Error while installing pg (1.1.3), and Bundler cannot continue
try instaling with pg-config like this:gem install pg -v 1.1.3 -- --with-pg-config=/usr/pgsql-9.X/bin/pg_config
.
In pg-config path mention the posgtres version installed in you're system.
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.
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.
Related Topics
What's the Best Way to Talk to a Database While Using Sinatra
Ruby/Rails: Convert Int to Time or Get Time from Integer
What Is the Best/How to Validate an Email Address in Ruby
Sprockets::Circulardependencyerror in Store#Index
Ruby Gem Not Found Although It Is Installed
Rails Assets Pipeline "Cannot Allocate Memory - Nodejs"
Ruby - Dynamically Add Property to Class (At Runtime)
Expected to Define. When Calling Class Inside a Module
Rails I18N via Database Column
Can't Get Rack-Cors Working in Rails Application
How to See the Dependency Tree Just from Gemfile
Attr_Accessor Strongly Typed Ruby on Rails
How to Use Xmlns Declarations with Xpath in Nokogiri
Millisecond Resolution of Datetime in Ruby
Rails "Undefined Method for Activerecord_Associations_Collectionproxy"