Monday, March 14, 2011

Installing pg for Windows (failed)

1. Tried to install pg but failed.
C:>pik gem install pg
ruby 1.8.6 (2010-02-04 patchlevel 398) [i386-mingw32]

ERROR:  Error installing pg:
pg requires Ruby version >= 1.8.7.

ruby 1.8.7 (2010-12-23 patchlevel 330) [i386-mingw32]

ERROR:  Error installing pg:
The 'pg' native gem requires installed build tools.

Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'

ruby 1.9.1p430 (2010-08-16 revision 28998) [i386-mingw32]

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

C:/Ruby191/bin/ruby.exe extconf.rb
checking for pg_config... yes
Using config values from C:\Program Files\PostgreSQL\9.0\bin/pg_config.exe
checking for libpq-fe.h... *** extconf.rb failed ***
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.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/libp
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby191/bin/ruby
--with-pg
--without-pg
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/lib
--with-pg-config
--without-pg-config
--with-pg_config
--without-pg_config
C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:364:in `try_do': The complier failed to genera
te an executable file. (RuntimeError)
You have to install development tools first.
from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:433:in `try_cpp'
from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:830:in `block in find_header'
from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:670:in `block in checking_for'
from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:276:in `block (2 levels) in postp
one'
from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:250:in `open'
from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:276:in `block in postpone'
from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:250:in `open'
from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:272:in `postpone'
from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:669:in `checking_for'
from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:829:in `find_header'
from extconf.rb:20:in 


Gem files will remain installed in C:/Ruby191/lib/ruby/gems/1.9.1/gems/pg-0.10.1
for inspection.
Results logged to C:/Ruby191/lib/ruby/gems/1.9.1/gems/pg-0.10.1/ext/gem_make.out


ruby 1.9.2p136 (2010-12-25) [i386-mingw32]

ERROR:  Error installing pg:
The 'pg' native gem requires installed build tools.

Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'

2. Tried again after installing DevKit but failed again.
C:\>pik gem install pg
ruby 1.8.6 (2010-02-04 patchlevel 398) [i386-mingw32]

ERROR:  Error installing pg:
        pg requires Ruby version >= 1.8.7.

ruby 1.8.7 (2010-12-23 patchlevel 330) [i386-mingw32]

ERROR:  Error installing pg:
        The 'pg' native gem requires installed build tools.

Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'

ruby 1.9.1p430 (2010-08-16 revision 28998) [i386-mingw32]

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

C:/Ruby191/bin/ruby.exe extconf.rb
checking for pg_config... yes
Using config values from C:\Program Files\PostgreSQL\9.0\bin/pg_config.exe
checking for libpq-fe.h... *** extconf.rb failed ***
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.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/Ruby191/bin/ruby
        --with-pg
        --without-pg
        --with-pg-dir
        --without-pg-dir
        --with-pg-include
        --without-pg-include=${pg-dir}/include
        --with-pg-lib
        --without-pg-lib=${pg-dir}/lib
        --with-pg-config
        --without-pg-config
        --with-pg_config
        --without-pg_config
C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:364:in `try_do': The complier failed to genera
te an executable file. (RuntimeError)
You have to install development tools first.
        from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:433:in `try_cpp'
        from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:830:in `block in find_header'
        from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:670:in `block in checking_for'
        from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:276:in `block (2 levels) in postp
one'
        from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:250:in `open'
        from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:276:in `block in postpone'
        from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:250:in `open'
        from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:272:in `postpone'
        from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:669:in `checking_for'
        from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:829:in `find_header'
        from extconf.rb:20:in


Gem files will remain installed in C:/Ruby191/lib/ruby/gems/1.9.1/gems/pg-0.10.1
 for inspection.
Results logged to C:/Ruby191/lib/ruby/gems/1.9.1/gems/pg-0.10.1/ext/gem_make.out


ruby 1.9.2p136 (2010-12-25) [i386-mingw32]

ERROR:  Error installing pg:
        The 'pg' native gem requires installed build tools.

Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'

No comments:

Post a Comment