Hello!
I'm trying to install ruby-pg gem on my Ubuntu 9.04
So I'm typing:
sudo gem install ruby-pg
Gem is downloaded from remote repository, but linking of native
library fails with following results:
------
Building native extensions. This could take a while...
ERROR: Error installing ruby-pg:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb install ruby-pg
checking for main() in -lpq... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.
--- cut ---
mkmf.log says:
------
have_library: checking for main() in -lpq... -------------------- no
"cc -o conftest -I. -I/usr/lib/ruby/1.8/i486-linux -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 -lruby1.8-static -lpq -
lpthread -ldl -lcrypt -lm -lc"
/usr/lib/libpq.so: undefined reference to
`krb5_cc_get_princi...@krb5_3_mit'
/usr/lib/libpq.so: undefined reference to
`gss_import_n...@gssapi_krb5_2_mit'
/usr/lib/libpq.so: undefined reference to
`gss_release_buf...@gssapi_krb5_2_mit'
--- cut ---
It looks, that libpq5 installed on my Ubuntu needs libkrb53 package.
Libkrb I have in standard place: /usr/lib, but krb5 library has to be
added to cc command as additional library.
So I'm using option "with-opt-lib" to "gem install":
sudo gem install ruby-pg -- --with-opt-lib=krb5
Now krb5 library appeared in -L command instead of -l (see below log),
what caused that native library still cannot be linked.
Here is mkmf.log:
------
have_library: checking for main() in -lpq... -------------------- no
"cc -o conftest -I. -I/usr/lib/ruby/1.8/i486-linux -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 -Lkrb5 -L. -Wl,-Bsymbolic-
functions -rdynamic -Wl,-export-dynamic -lruby1.8-static -lpq -
lpthread -ldl -lcrypt -lm -lc"
/usr/lib/libpq.so: undefined reference to
`krb5_cc_get_princi...@krb5_3_mit'
/usr/lib/libpq.so: undefined reference to
`gss_import_n...@gssapi_krb5_2_mit'
/usr/lib/libpq.so: undefined reference to
`gss_release_buf...@gssapi_krb5_2_mit'
/usr/lib/libpq.so: undefined reference to
`krb5_free_unparsed_n...@krb5_3_mit'
--- cut ---
Questions are:
1. Why --with-opt-lib adds entry to -L ?
2. How to add additonal library (krb5), which should be linked to
native library?
My environment is:
ubuntu 9.04
ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]
gem --version 1.3.1
ruby-pg-0.7.9.2008.01.28
postgresql 8.3.7-1
libpq5
libkrb53
Regards,
Mariusz Wojtysiak
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---