PostgreSQL アダプタ はまり道

ちょっとはまっているのでメモ

Building native extensions.  This could take a while...
ERROR:  Error installing postgres:
	ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb install postgres --no-rdoc --no-ri --version > 0

make
gcc -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I. -DHAVE_LIBPQ_FE_H -DHAVE_LIBPQ_LIBPQ_FS_H -I/opt/local/include/postgresql83  -fno-common -arch ppc -arch i386 -Os -pipe -fno-common  -c libpq-compat.c
libpq-compat.c: In function 'PQescapeBytea':
libpq-compat.c:104: warning: incompatible implicit declaration of built-in function 'sprintf'
libpq-compat.c:104: warning: pointer targets in passing argument 1 of 'sprintf' differ in signedness
libpq-compat.c: In function 'PQunescapeBytea':
libpq-compat.c:158: warning: incompatible implicit declaration of built-in function 'strlen'
libpq-compat.c:158: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness
libpq-compat.c: In function 'PQescapeBytea':
libpq-compat.c:104: warning: incompatible implicit declaration of built-in function 'sprintf'
libpq-compat.c:104: warning: pointer targets in passing argument 1 of 'sprintf' differ in signedness
libpq-compat.c: In function 'PQunescapeBytea':
libpq-compat.c:158: warning: incompatible implicit declaration of built-in function 'strlen'
libpq-compat.c:158: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness
gcc -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I. -DHAVE_LIBPQ_FE_H -DHAVE_LIBPQ_LIBPQ_FS_H -I/opt/local/include/postgresql83  -fno-common -arch ppc -arch i386 -Os -pipe -fno-common  -c postgres.c
postgres.c:41: error: static declaration of 'PQserverVersion' follows non-static declaration
/opt/local/include/postgresql83/libpq-fe.h:262: error: previous declaration of 'PQserverVersion' was here
postgres.c:41: error: static declaration of 'PQserverVersion' follows non-static declaration
/opt/local/include/postgresql83/libpq-fe.h:262: error: previous declaration of 'PQserverVersion' was here
postgres.c: In function 'Init_postgres':
postgres.c:2676: error: 'pgconn_protocol_version' undeclared (first use in this function)
postgres.c:2676: error: (Each undeclared identifier is reported only once
postgres.c:2676: error: for each function it appears in.)
postgres.c:2677: error: 'pgconn_server_version' undeclared (first use in this function)
postgres.c: In function 'Init_postgres':
postgres.c:2676: error: 'pgconn_protocol_version' undeclared (first use in this function)
postgres.c:2676: error: (Each undeclared identifier is reported only once
postgres.c:2676: error: for each function it appears in.)
postgres.c:2677: error: 'pgconn_server_version' undeclared (first use in this function)
lipo: can't open input file: /var/folders/0J/0JkmgbYCHTygjWSmQI1vL++++TI/-Tmp-//cccMThQY.out (No such file or directory)
make: *** [postgres.o] Error 1


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/postgres-0.7.9.2008.01.28 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/postgres-0.7.9.2008.01.28/ext/gem_make.out

JRuby でも

Building native extensions.  This could take a while...
ERROR:  Error installing postgres:
	ERROR: Failed to build gem native extension.

/Users/ofukui/Desktop/jruby-1.1RC3/bin/jruby extconf.rb install postgres --no-rdoc --no-ri --version > 0


Gem files will remain installed in /Users/ofukui/Desktop/jruby-1.1RC3/lib/ruby/gems/1.8/gems/postgres-0.7.9.2008.01.28 for inspection.
Results logged to /Users/ofukui/Desktop/jruby-1.1RC3/lib/ruby/gems/1.8/gems/postgres-0.7.9.2008.01.28/ext/gem_make.out

コマンドライン直でも

$ sudo jruby -S gem install ruby-postgres -- --with-pgsql-include-dir=/usr/local/pgsql --with-pgsql-lib-dir=/usr/local/libPassword:
Building native extensions.  This could take a while...
extconf.rb:6:in `require': no such file to load -- mkmf (LoadError)
	from extconf.rb:6
ERROR:  Error installing ruby-postgres:
	ERROR: Failed to build gem native extension.

/Users/ofukui/Desktop/jruby-1.1RC3/bin/jruby extconf.rb install ruby-postgres -- --with-pgsql-include-dir=/usr/local/pgsql --with-pgsql-lib-dir=/usr/local/lib


Gem files will remain installed in /Users/ofukui/Desktop/jruby-1.1RC3/lib/ruby/gems/1.8/gems/ruby-postgres-0.7.1.2006.04.06 for inspection.
Results logged to /Users/ofukui/Desktop/jruby-1.1RC3/lib/ruby/gems/1.8/gems/ruby-postgres-0.7.1.2006.04.06/gem_make.out