# Huge problem installing Postgres ruby 1.9 on Vista

**URL:** <https://www.ruby-forum.com/t/huge-problem-installing-postgres-ruby-1-9-on-vista/164059>\
**Category:** Ruby\
**Created:** [March 27, 2009, 11:40am UTC](https://www.ruby-forum.com/t/huge-problem-installing-postgres-ruby-1-9-on-vista/164059 "2009-03-27T11:40:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ther](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/977dab/32.png) [@ther](https://www.ruby-forum.com/u/ther)\
**Post date:** [March 27, 2009, 11:40am UTC](https://www.ruby-forum.com/t/huge-problem-installing-postgres-ruby-1-9-on-vista/164059/1 "2009-03-27T11:40:14Z")

</div>

Werent there times when windows gems were precompiled for Windows.

#######################  
gem install ruby-pg

extconf.rb:4:in `’: uninitialized constant PLATFORM (NameError)

Ok I have edited extconf.rb and add PLATFORM=‘mswin’  
only to get:

c:/ruby19/lib/ruby/1.9.1/mkmf.rb:362:in `try\_do’: The complier failed to  
generat  
e an executable file. (RuntimeError)  
You have to install development tools first.

Same goes for postgres gem.

########################  
Than I tried to go DBI.  
gem install dbi  
gem install dbd-pg

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

c:/ruby19/bin/ruby.exe extconf.rb install dbd-pg --no-rdoc --no-ri  
ERROR: can’t find pg\_config.  
HINT: Make sure pg\_config is in your PATH  
\*\*\* extconf.rb failed \*\*\*

My postgres server is on Linux. I don’t need it to be installed localy.  
But I think it would die anyway because I don have c installed.

#########################

Ok do some handwork. Download source files from sourceforge, unzip, go  
to directory, run ruby setup.rb.  
Suprisingly it did well. Both for dbi and dbd-pg. But when I try to run  
I get:

c:/ruby19/lib/ruby/site\_ruby/1.9.1/dbi.rb:312:in `rescue in load_driver': Could not load driver (undefined local variable or method`e’ for DBI:Module)  
(DBI::In  
terfaceError)  
from c:/ruby19/lib/ruby/site\_ruby/1.9.1/dbi.rb:236:in  
`load_driver' from c:/ruby19/lib/ruby/site_ruby/1.9.1/dbi.rb:154:in`\_get\_full\_driver’

```
    from c:/ruby19/lib/ruby/site_ruby/1.9.1/dbi.rb:139:in `connect'
    from rubyArchiveTesti.rb:16:in `preveriIzXML_Angry'
    from rubyArchiveTesti.rb:124:in `<main>'

```

##############################  
Ok. Delete from site\_ruby and copy files from old 1.8 directory.

c:/ruby19/lib/ruby/gems/1.9.1/gems/dbi-0.4.1/lib/dbi.rb:294:in `block in load_dr iver': Unable to load driver 'Pg' (underlying error: uninitialized constant DBI: :DBD::Pg) (DBI::InterfaceError) from c:/ruby19/lib/ruby/1.9.1/monitor.rb:190:in`mon\_synchronize’  
from  
c:/ruby19/lib/ruby/gems/1.9.1/gems/dbi-0.4.1/lib/dbi.rb:236:in `loa d_driver' from c:/ruby19/lib/ruby/gems/1.9.1/gems/dbi-0.4.1/lib/dbi.rb:154:in`\_ge  
t\_full\_driver’  
from  
c:/ruby19/lib/ruby/gems/1.9.1/gems/dbi-0.4.1/lib/dbi.rb:139:in `con nect' from rubyArchiveTesti.rb:16:in`preveriIzXML\_Angry’  
from rubyArchiveTesti.rb:124:in `’

Here is where I give up.

Has anybody been able to succesfully install dbi with support for  
postgres on ruby 1.9.1 and windows vista (xp).

by  
TheR
