Search code examples
ruby-on-railsrubyrubygemspg

Problems while installing pg gem


I need to install pg gem, but the installation failed. I've tried all the solution propesed in other questions but no luck.

Here is my output, and here is my "mkmf.log" file

Any idea?

[UPDATE]

I've solved the first problem by putting libs in the correct directory. But now I've another problem:

find_executable: checking for pg_config... -------------------- yes

--------------------

"gcc -o conftest -I/usr/include/ruby-1.9.1/i686-linux -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -I/usr/include/postgresql  -D_FILE_OFFSET_BITS=64  -fno-strict-aliasing -g -g -O2 -fPIC conftest.c  -L. -L/usr/lib -L/usr/lib -L. -Wl,-Bsymbolic-functions -rdynamic -Wl,-export-dynamic     -lruby-1.9.1-static  -lpthread -lrt -ldl -lcrypt -lm   -lc"
/usr/bin/ld: cannot find crtbegin.o: No such file or directory
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main() {return 0;}
/* end */

[UPDATE2]

Solved it by putting links to "libgcc", "libgcc_s", "crtend.o", "crtendS.o", "crtbeginS.o" and "crtbegin.o" into /usr/lib


Solution

  • It looks like you are missing development libraries even for glibc. Just install devel packages for glibc and postgresql and try again.