Thursday 5 April 2012

Generic Gem Install Error Solving


Installing pg (0.13.2) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.


/usr/bin/ruby1.9.1 extconf.rb 
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
 --with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***

I highlighted the interesting bit. If you are on Ubuntu, the header is generally related to the package you are missing.
If you type libpq in a terminal, it helpfully tells you to try sudo apt-get install libpq
That will deal with this problem and many others like it.

Other variants of the problem are similar to the stack overflow problem: http://stackoverflow.com/q/10198002/193785
Here it is not a .h file but as some other kind of generic library. checking for main() in -lopenal... no

1:Sudo apt-get install openal
2:Sudo apt-get install openal-dev
3:Sudo apt-get install libopenal

One of these three solutions will probably work.

No comments:

Post a Comment