Issue #62 resolved

Attempt to install pg following instructions fails

John Poole
created an issue

=== Goal: I want to connect to PostgreSQL from Ruby. ===

I installed Ruby and tried to install within the fresh installation. Here are my notes:

ran rubyinstaller-1.9.2-p180.exe

Selected path: C:\Ruby\192 (note: default was Ruby192, I isolated the 192)

  • Added Ruby to the Path

  • Associated rb with this installation

Confirmed install: opened DOS console: {{{ C:\Documents and Settings\jlpoole>ruby -v ruby 1.9.2p180 (2011-02-18) [i386-mingw32] C:\Documents and Settings\jlpoole> }}}

Using instructions at https://bitbucket.org/ged/ruby-pg/wiki/Home {{{ C:\Documents and Settings\jlpoole>gem install pg Fetching: pg-0.10.1.gem (100%) 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'

C:\Documents and Settings\jlpoole> }}}

The current instructions at https://bitbucket.org/ged/ruby-pg/wiki/Home provide: {{{

ruby-pg: Ruby interface to PostgreSQL RDBMS

This is the extension library to access a PostgreSQL database from Ruby. This library works with PostgreSQL 7.4 and later.
Requirements

    Ruby 1.8.6 or later.
    PostgreSQL 7.3 or later installed.

It may work with earlier versions as well, but those are not regularly tested.
How To Install

Install via RubyGems:

gem install pg

Or install from source:

rake install

You may need to specify the path to the 'pg_config' program installed with Postgres:

rake -- --with-pg-config=<path to pg_config>

For example, on a Mac with PostgreSQL installed via MacPorts (port install postgresql84):

rake install -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config

See MacOS X Instructions for more information about installing under MacOS X, and Win32 Instructions for Windows build/installation instructions.

}}}

My operating system is:

  • From the DOS console: Microsoft Windows XP [Version 5.1.2600]
  • From the System Properties: Microsoft Windows XP Profession Version 2002 Service Pack 3

I have PostgreSQL installed at: C:\Program Files\PostgreSQL\8.4

It appears I need to have a development kit installed? Shouldn't the instructions indicate that? I've tried to install the development kit and have had problems and am pursuing that with the appropriate group.

Comments (22)

  1. John Poole reporter

    Putting this on hold.

    I had previously tried to use the git repository for the devkit and ran into problems. I'm using the standard instructions now and seem to be making progress. It looks like I have the missing headers issue which I'll resolve by finding them or downloading them and then using the "--with-pg-config" parameter.

  2. John Poole reporter

    Got it working. What threw me were two things:

    1) trying to pull from GIT the development kit. I thought I'd ride the high watermark and apparently did not know my way around the pulled tree well enough. I back stepped and simply followed the instructions for installing the development kit

    2) The path. my Postgres was in the default path of C:\Program Files\PostgreSQL\8.4. So I modified my DOS PATH variable to point to "C:\Program Files\PostgreSQL\8.4\bin". The pg_config.exe was found, but the install failed later down the road because of the space in "Program Files". I tried to append to the PATH "C:\Progra1\PostgreSQL\8.4" and the prior presence of "C:\Program Files\PostgreSQL\8.4" seemed to prevent a successful install. So, I started a fresh DOS session, tainted by PATH statement with:

    	C:\>set PATH=%PATH%;C:\Progra~1\PostgreSQL\8.4\bin
    
    	C:\>gem install pg
    	Temporarily enhancing PATH to include DevKit...
    	Building native extensions.  This could take a while...
    	Successfully installed pg-0.10.1
    	1 gem installed
    	Installing ri documentation for pg-0.10.1...
    	Installing RDoc documentation for pg-0.10.1...
    
    	C:\>
    
    

    So, here's a recap successful steps for installation on Windows XP:

    ran rubyinstaller-1.9.2-p180.exe
    Selected path: C:\Ruby\192  (note: default was Ruby192, I isolated the 192)
    	Added Ruby to the Path
    	Associated rb with this installation
    Confirmed install: opened DOS console:
    
    	C:\Documents and Settings\jlpoole>ruby -v
    	ruby 1.9.2p180 (2011-02-18) [i386-mingw32]
    
    	C:\Documents and Settings\jlpoole>
    
    In C:\Downloads\Ruby, DevKit-tdm-32-4.5.1-20101214-1400-sfx.exe and specified the extraction directory: C:\Ruby\devkit
    ran "ruby dk.rb init"
    verified in C:\Ruby\devkit\confi.yml: "- C:/Ruby/192"
    

    Then:

    	C:\>set PATH=%PATH%;C:\Progra~1\PostgreSQL\8.4\bin
    
    	C:\>gem install pg
    	Temporarily enhancing PATH to include DevKit...
    	Building native extensions.  This could take a while...
    	Successfully installed pg-0.10.1
    	1 gem installed
    	Installing ri documentation for pg-0.10.1...
    	Installing RDoc documentation for pg-0.10.1...
    
    	C:\>
    
    

    Subsequent to getting this to work, I learned of the DBI module, and since I come from Perl and use DBI extensively, the DBI and Pg combination looks to be a more adaptable solution.

  3. Anonymous

    Above was focused on getting a successful install confirmation, it did not test whether the install actually worked.

    It looks like pg is installing okay, but when it actually is called upon, it fails. A simple file:

    require 'pg'
    

    results in:

    D:\work\Ruby>ruby test_postgres_basic_pg.rb
    <internal:lib/rubygems/custom_require>:29:in `require': no such file to load --
    1.9/pg_ext (LoadError)
            from <internal:lib/rubygems/custom_require>:29:in `require'
            from C:/Ruby/192/lib/ruby/gems/1.9.1/gems/pg-0.10.1/lib/pg.rb:10:in `res
    cue in <top (required)>'
            from C:/Ruby/192/lib/ruby/gems/1.9.1/gems/pg-0.10.1/lib/pg.rb:3:in `<top
     (required)>'
            from <internal:lib/rubygems/custom_require>:33:in `require'
            from <internal:lib/rubygems/custom_require>:33:in `rescue in require'
            from <internal:lib/rubygems/custom_require>:29:in `require'
            from test_postgres_basic_pg.rb:2:in `<main>'
    
    D:\work\Ruby>
    

    This has ramification downstream, as I installed the DBD-pg module and it appears to install okay, but then fails when actually called to use.

    Here's a log of my system (fresh 1.9.2 install):

    C:\Ruby\devkit>ruby dk.rb init
    [INFO] found RubyInstaller v1.8.6 at C:/Ruby/186
    [INFO] found RubyInstaller v1.9.2 at C:/Ruby/192
    
    Initialization complete! Please review and modify the auto-generated
    'config.yml' file to ensure it contains the root directories to all
    of the installed Rubies you want enhanced by the DevKit.
    
    C:\Ruby\devkit>ruby dk.rb review
    Based upon the settings in the 'config.yml' file generated
    from running 'ruby dk.rb init' and any of your customizations,
    DevKit functionality will be injected into the following Rubies
    when you run 'ruby dk.rb install'.
    
    C:/Ruby/186
    C:/Ruby/192
    
    C:\Ruby\devkit>ruby dk.rb install
    [INFO] Skipping existing gem override for 'C:/Ruby/186'
    [WARN] Skipping existing DevKit helper library for 'C:/Ruby/186'
    [INFO] Updating convenience notice gem override for 'C:/Ruby/192'
    [INFO] Installing 'C:/Ruby/192/lib/ruby/site_ruby/devkit.rb'
    
    C:\Ruby\devkit>gem install rdiscount --platform=ruby
    Fetching: rdiscount-1.6.8.gem (100%)
    Temporarily enhancing PATH to include DevKit...
    Building native extensions.  This could take a while...
    Successfully installed rdiscount-1.6.8
    1 gem installed
    Installing ri documentation for rdiscount-1.6.8...
    Installing RDoc documentation for rdiscount-1.6.8...
    
    C:\Ruby\devkit>gem install pg
    Temporarily enhancing PATH to include DevKit...
    Building native extensions.  This could take a while...
    ERROR:  Error installing pg:
            ERROR: Failed to build gem native extension.
    
            C:/Ruby/192/bin/ruby.exe extconf.rb
    checking for pg_config... no
    No pg_config... trying anyway. If building fails, please try again with
     --with-pg-config=/path/to/pg_config
    checking for libpq-fe.h... no
    Can't find the 'libpq-fe.h header
    *** 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:/Ruby/192/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
    
    
    Gem files will remain installed in C:/Ruby/192/lib/ruby/gems/1.9.1/gems/pg-0.10.
    1 for inspection.
    Results logged to C:/Ruby/192/lib/ruby/gems/1.9.1/gems/pg-0.10.1/ext/gem_make.ou
    t
    
    C:\Ruby\devkit> gem install pg -- --with-pg-config=C:/Progra~1/Postgr~1/8.4/bin/
    pg_config.exe
    Temporarily enhancing PATH to include DevKit...
    Building native extensions.  This could take a while...
    Successfully installed pg-0.10.1
    1 gem installed
    Installing ri documentation for pg-0.10.1...
    Installing RDoc documentation for pg-0.10.1...
    
    C:\Ruby\devkit>d:
    
    D:\>cd work
    
    D:\work>cd ruby
    
    D:\work\Ruby>dir
     Volume in drive D is Data
     Volume Serial Number is 140B-B21E
    
     Directory of D:\work\Ruby
    
    04/01/2011  05:15 AM    <DIR>          .
    04/01/2011  05:15 AM    <DIR>          ..
    04/01/2011  04:51 AM             1,766 pg_install_notes.txt
    04/01/2011  04:09 AM    <DIR>          postgres-0.7.9.2008.01.28
    04/01/2011  03:36 AM            32,768 postgres-0.7.9.2008.01.28.gem
    03/09/2011  08:29 AM               906 test_dbi_dbd-mysql.rb
    03/09/2011  08:04 AM               906 test_dbi_dbd-pg.rb
    03/06/2011  03:14 PM                 0 test_mysql.rb
    03/06/2011  09:07 PM               733 test_mysql2.rb
    04/01/2011  04:53 AM               503 test_postgres.rb
    04/01/2011  05:01 AM                35 test_postgres_basic.rb
    04/01/2011  05:15 AM                29 test_postgres_basic_pg.rb
                   9 File(s)         37,646 bytes
                   3 Dir(s)  586,526,842,880 bytes free
    
    D:\work\Ruby>ruby test_postgres_basic_pg.rb
    <internal:lib/rubygems/custom_require>:29:in `require': no such file to load --
    1.9/pg_ext (LoadError)
            from <internal:lib/rubygems/custom_require>:29:in `require'
            from C:/Ruby/192/lib/ruby/gems/1.9.1/gems/pg-0.10.1/lib/pg.rb:10:in `res
    cue in <top (required)>'
            from C:/Ruby/192/lib/ruby/gems/1.9.1/gems/pg-0.10.1/lib/pg.rb:3:in `<top
     (required)>'
            from <internal:lib/rubygems/custom_require>:33:in `require'
            from <internal:lib/rubygems/custom_require>:33:in `rescue in require'
            from <internal:lib/rubygems/custom_require>:29:in `require'
            from test_postgres_basic_pg.rb:2:in `<main>'
    
    D:\work\Ruby> gem install pg  -- --with-pg-config=C:/Progra~1/Postgr~1/8.4/bin/p
    g_config.exe --with-pg-dir=C:/Progra~1/Postgr~1/8.4
    Temporarily enhancing PATH to include DevKit...
    Building native extensions.  This could take a while...
    Successfully installed pg-0.10.1
    1 gem installed
    Installing ri documentation for pg-0.10.1...
    Installing RDoc documentation for pg-0.10.1...
    
    D:\work\Ruby>ruby test_postgres_basic_pg.rb
    <internal:lib/rubygems/custom_require>:29:in `require': no such file to load --
    1.9/pg_ext (LoadError)
            from <internal:lib/rubygems/custom_require>:29:in `require'
            from C:/Ruby/192/lib/ruby/gems/1.9.1/gems/pg-0.10.1/lib/pg.rb:10:in `res
    cue in <top (required)>'
            from C:/Ruby/192/lib/ruby/gems/1.9.1/gems/pg-0.10.1/lib/pg.rb:3:in `<top
     (required)>'
            from <internal:lib/rubygems/custom_require>:33:in `require'
            from <internal:lib/rubygems/custom_require>:33:in `rescue in require'
            from <internal:lib/rubygems/custom_require>:29:in `require'
            from test_postgres_basic_pg.rb:2:in `<main>'
    
    D:\work\Ruby>gem install dbi
    Fetching: deprecated-2.0.1.gem (100%)
    Fetching: dbi-0.4.5.gem (100%)
    Successfully installed deprecated-2.0.1
    Successfully installed dbi-0.4.5
    2 gems installed
    Installing ri documentation for deprecated-2.0.1...
    Installing ri documentation for dbi-0.4.5...
    Installing RDoc documentation for deprecated-2.0.1...
    Installing RDoc documentation for dbi-0.4.5...
    
    D:\work\Ruby>gem install dbd-pg
    Fetching: dbd-pg-0.3.9.gem (100%)
    Successfully installed dbd-pg-0.3.9
    1 gem installed
    Installing ri documentation for dbd-pg-0.3.9...
    Installing RDoc documentation for dbd-pg-0.3.9...
    
    D:\work\Ruby>ruby -v
    ruby 1.9.2p180 (2011-02-18) [i386-mingw32]
    
    D:\work\Ruby>ruby test_postgres_basic_dbi-pg.rb
    <internal:lib/rubygems/custom_require>:29:in `require': no such file to load --
    dbd-pg (LoadError)
            from <internal:lib/rubygems/custom_require>:29:in `require'
            from test_postgres_basic_dbi-pg.rb:3:in `<main>'
    
    D:\work\Ruby>gem list
    
    *** LOCAL GEMS ***
    
    dbd-pg (0.3.9)
    dbi (0.4.5)
    deprecated (2.0.1)
    minitest (1.6.0)
    pg (0.10.1)
    rake (0.8.7)
    rdiscount (1.6.8)
    rdoc (2.5.8)
    
    D:\work\Ruby>irb -r rubygems
    irb(main):001:0> gem 'pg'
    => true
    irb(main):002:0> gem 'dbi'
    => true
    irb(main):003:0> quit
    
    D:\work\Ruby>
    
    

    Maybe the postgresql install/libraries need to be in my path?

  4. Michael Granger repo owner

    I'm not sure why your installation is failing, but it looks as if the gem is only half-installed. If you look in 'C:/Ruby/192/lib/ruby/gems/1.9.1/gems/pg-0.10.1/lib/1.9', is there a pg_ext.so?

  5. John Poole reporter

    There's no 1.9 subdirectory in my path as is in the path you describe.

    C:\Ruby\192\lib\ruby\gems\1.9.1\gems\pg-0.10.1\lib>dir
     Volume in drive C has no label.
     Volume Serial Number is 480B-2BE2
    
     Directory of C:\Ruby\192\lib\ruby\gems\1.9.1\gems\pg-0.10.1\lib
    
    04/01/2011  05:31 AM    <DIR>          .
    04/01/2011  05:31 AM    <DIR>          ..
    04/01/2011  05:31 AM               365 pg.rb
    04/01/2011  05:31 AM            62,976 pg_ext.so
                   2 File(s)         63,341 bytes
                   2 Dir(s)  11,188,453,376 bytes free
    
    C:\Ruby\192\lib\ruby\gems\1.9.1\gems\pg-0.10.1\lib>
    
    
  6. kenleslie

    I'm having the same issue with Ruby 1.8.7 + DevKit. The gem installs and compiles correctly, but when I try to require the gem I get:

    require 'rubygems'
    require 'pg'
    LoadError: no such file to load -- 1.8/pg_ext
    	from C:/Ruby187p334/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
    	from C:/Ruby187p334/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
    	from C:/Ruby187p334/lib/ruby/gems/1.8/gems/pg-0.10.1/lib/pg.rb:10
    	from C:/Ruby187p334/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
    	from C:/Ruby187p334/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
    	from (irb):8
    

    In reference to the comment above, I do not have the 1.8 subdirectory in my path:

    C:\Ruby187p334\lib\ruby\gems\1.8\gems\pg-0.10.1\lib>dir
     Volume in drive C is OS
     Volume Serial Number is 0004-686A
    
     Directory of C:\Ruby187p334\lib\ruby\gems\1.8\gems\pg-0.10.1\lib
    
    04/04/2011  11:40 AM    <DIR>          .
    04/04/2011  11:40 AM    <DIR>          ..
    04/04/2011  12:26 PM               365 pg.rb
    04/04/2011  11:40 AM            45,056 pg_ext.so
                   2 File(s)         45,421 bytes
                   2 Dir(s)  104,472,932,352 bytes free
    
  7. Michael Granger repo owner

    Okay, the version-qualified extension should only be loaded as a fallback for an error while loading the one under pg-0.10.1/lib, which means there's probably an exception being raised when it loads pg_ext from the lib/ directory. Can either of you try running the programming with debugging enabled (-d option for either irb or ruby) to hopefully show the earlier error?

    Thanks.

  8. Michael Granger repo owner

    Very mysterious. This part of the error message is the actual problem:

    Exception `LoadError' at C:/Ruby/192/lib/ruby/gems/1.9.1/gems/pg-0.10.1/lib/pg_ext.so - 126: 
    The specified module could not be found.   - 
    C:/Ruby/192/lib/ruby/gems/1.9.1/gems/pg-0.10.1/lib/pg_ext.so
    

    But then immediately afterwards, your 'dir' in 'C:/Ruby/192/lib/ruby/gems/1.9.1/gems/pg-0.10.1/lib' shows that pg_ext.so is indeed there.

    I suspect the dialog it shows ("This application has failed to start because LIBPQ.dll was not found. Re-installing the application may fix the problem") is the root cause. Unfortunately, I don't know what the fix for that is. It looks like some problem with the PostgreSQL client library, but I don't know enough about Windows programming to be able to diagnose it.

  9. Anonymous

    I also had problems with installing the pg gem. Installing version 0.9.0 instead fo 0.10.1 worked for me.

  10. John Poole reporter
    • changed status to open

    Thank you Anonymous who posted 1 week ago.

    Here's what I did. Note, this is in the Ruby 1.9.2 environment, not the 1.8.7 which is what I ultimately desire since 1.8.7 is what SketchUp uses.

    C:\Documents and Settings\jlpoole>gem list --local
    
    *** LOCAL GEMS ***
    
    dbd-pg (0.3.9)
    dbi (0.4.5)
    deprecated (2.0.1)
    minitest (1.6.0)
    pg (0.10.1)
    rake (0.8.7)
    rdiscount (1.6.8)
    rdoc (2.5.8)
    
    C:\Documents and Settings\jlpoole>gem uninstall pg
    
    You have requested to uninstall the gem:
            pg-0.10.1
    dbd-pg-0.3.9 depends on [pg (>= 0)]
    If you remove this gems, one or more dependencies will not be met.
    Continue with Uninstall? [Yn]  y
    Successfully uninstalled pg-0.10.1
    
    C:\Documents and Settings\jlpoole>gem install -v 0.9.0 pg
    Fetching: pg-0.9.0-x86-mingw32.gem (100%)
    Successfully installed pg-0.9.0-x86-mingw32
    1 gem installed
    Installing ri documentation for pg-0.9.0-x86-mingw32...
    Installing RDoc documentation for pg-0.9.0-x86-mingw32...
    
    C:\Documents and Settings\jlpoole>d:
    
    D:\>cd work\ruby
    
    D:\work\Ruby>ruby test_postgres_basic_pg.rb
    
    D:\work\Ruby>ruby test_postgres_basic_dbi-pg.rb
    <internal:lib/rubygems/custom_require>:29:in `require': no such file to load --
    dbd-pg (LoadError)
            from <internal:lib/rubygems/custom_require>:29:in `require'
            from test_postgres_basic_dbi-pg.rb:3:in `<main>'
    
    D:\work\Ruby>gem uninstall dbd-pg
    Successfully uninstalled dbd-pg-0.3.9
    
    D:\work\Ruby>gem install dbd-pg
    Fetching: dbd-pg-0.3.9.gem (100%)
    Successfully installed dbd-pg-0.3.9
    1 gem installed
    Installing ri documentation for dbd-pg-0.3.9...
    Installing RDoc documentation for dbd-pg-0.3.9...
    
    D:\work\Ruby>ruby test_dbi_dbd-pg.rb
    lib/rational.rb is deprecated
    C:/Ruby/192/lib/ruby/gems/1.9.1/gems/dbi-0.4.5/lib/dbi/handles.rb:12: warning: o
    ptional boolean argument is obsoleted
    Server version: PostgreSQL 8.4.4, compiled by Visual C++ build 1400, 32-bit
    [1, "one"]
    [2, "two"]
    [3, "apples"]
    [4, "oranges"]
    [5, "watermelons"]
    
    D:\work\Ruby>
    

    Here's the test script I used:

    #!/usr/bin/ruby -w
    # simple.rb - simple MySQL script using Ruby DBI module
    #
    # for database drivers, see: http://ruby-dbi.rubyforge.org/rdoc/index.html and "Classes"
    # for Mysql, Pg, SQLite, ODBC
    #
    require 'rubygems'
    
    require "dbi"
    
    #require 'dbd-pg'
    #require 'pg'
    begin
     # connect to the Postegresql server
     dbh = DBI.connect("DBI:Pg:test", "rubyscript", "test")
     # get server version string and display it
     row = dbh.select_one("SELECT VERSION()")
     puts "Server version: " + row[0]
     
     # Select all rows from sample_data
    sth = dbh.prepare('select * from ruby.sample_data')
    sth.execute
    
    # Print out each row
    while row=sth.fetch do
    	p row
    end
    
    # Close the statement handle when done
    sth.finish
    
    rescue DBI::DatabaseError => e
     puts "An error occurred"
     puts "Error code: #{e.err}"
     puts "Error message: #{e.errstr}"
    ensure
     # disconnect from server
     dbh.disconnect if dbh
    end
    

    Next: I'll try in the Ruby 1.8.6 environment.

    Also, what does it mean that a bug is placed on HOLD? I've changed the status from HOLD to OPEN pending to prompt an answer to this question. If two people and three machines cannot get the code working, doesn't that indicate a bug somewhere that should remain open until determined what causes the problem (or the discrepancy among environments)?

  11. John Poole reporter
    • changed status to new

    Success -- I got 0.9.0 to work in Ruby 1.8.6. Here's what I did:

    	#
    	# steps to uninstall high watermark
    	#
    	gem uninstall dbd-pg
    	gem uninstall pg
    	#
    	# steps to install pg 0.9.0
    	#
    	gem install -v 0.9.0 pg
    	gem install dbd-pg
    

    Here's the log:

    ruby 1.8.6 (2010-02-04 patchlevel 398) [i386-mingw32]
    
    C:\Documents and Settings\jlpoole>gem uninstall dbd-pg
    Successfully uninstalled dbd-pg-0.3.9
    
    C:\Documents and Settings\jlpoole>gem uninstall pg
    Successfully uninstalled pg-0.10.1
    
    C:\Documents and Settings\jlpoole>gem install -v 0.9.0 pg
    Successfully installed pg-0.9.0-x86-mingw32
    1 gem installed
    Installing ri documentation for pg-0.9.0-x86-mingw32...
    Installing RDoc documentation for pg-0.9.0-x86-mingw32...
    
    C:\Documents and Settings\jlpoole>gem install dbd-pg
    Successfully installed dbd-pg-0.3.9
    1 gem installed
    Installing ri documentation for dbd-pg-0.3.9...
    Installing RDoc documentation for dbd-pg-0.3.9...
    
    C:\Documents and Settings\jlpoole>d:
    
    D:\>cd work\ruby
    
    D:\work\Ruby>ruby test_dbi_dbd-pg.rb
    Server version: PostgreSQL 8.4.4, compiled by Visual C++ build 1400, 32-bit
    [1, "one"]
    [2, "two"]
    [3, "apples"]
    [4, "oranges"]
    [5, "watermelons"]
    
    D:\work\Ruby>ruby -v
    ruby 1.8.6 (2010-02-04 patchlevel 398) [i386-mingw32]
    
    D:\work\Ruby>
    

    I'm leaving the status to OPEN, but as far as I am concerned, I've achieved my goal of connecting to PostgreSQL from Ruby 1.8.6. I leave it to the maintainers of this code to classify the status of this issue.

    I'll be happy to help test by 0.9.0 and 0.10.x do not work since there seems to be an issue with others recreating the problem.

  12. Michael Granger repo owner

    "On hold" to me means that the conversation has ceased, and so I'm not going to look at it again until someone replies. Changing it from "on hold" back to "open", especially as the original ticket-opener seems perfectly acceptable to me if you're also providing some new information.

    This ticket has gotten quite cluttered with comments and I'm not sure who's still watching besides you and I, so I'm going to close it since you've achieved your goal.

    I'm planning on releasing a new version later today with binary, statically-compiled Windows gems, which should go a long way towards fixing the situation for Windows users.

    Anyway, thanks for your excellent bug reports.

  13. Michael Granger repo owner

    I forgot to mention: if you're still watching this ticket, and you still have problems with the version I'm going to release in a few hours, Then please open a new ticket, include your 'mkmf.log' if you're installing via the DevKit instead of a binary gem, and include any errors you see.

    Thanks.

  14. Daniel Macho

    fyi

    I have got the very same problem when trying to use gem pg 0.17.0 (or pg 0.17.1) with ruby v2.1.3 (and pik) and PostgreSQL 9.3:

    • After installing pg there is a missing 2.1 folder under lib and I receive the following problem when running rake db:migrate

    C:\railsprojects\project>rake db:migrate DL is deprecated, please use Fiddle rake aborted! LoadError: cannot load such file -- 2.1/pg_ext C:/railsprojects/project/config/application.rb:10:in <top (required)>' C:/railsprojects/project/Rakefile:5:in<top (required)>' LoadError: cannot load such file -- pg_ext C:/railsprojects/timeoverflow/config/application.rb:10:in <top (required)>' C:/railsprojects/timeoverflow/Rakefile:5:in<top (required)>' (See full trace by running task with --trace)

    • Even if I try to copy pg_ext from existing 2.0 folder into a new created 2.1 folder does not work. File can be found but similar error shows stating that cannot be loaded.

    C:\railsprojects\project>rake db:migrate DL is deprecated, please use Fiddle rake aborted! LoadError: 126: The specified module could not be found. - C:/tools/ruby213/li b/ruby/gems/2.1.0/gems/pg-0.17.0-x86-mingw32/lib/2.1/pg_ext.so C:/railsprojects/project/config/application.rb:10:in <top (required)>' C:/railsprojects/project/Rakefile:5:in<top (required)>' LoadError: cannot load such file -- pg_ext C:/railsprojects/project/config/application.rb:10:in <top (required)>' C:/railsprojects/project/Rakefile:5:in<top (required)>' (See full trace by running task with --trace)

    • Even enabling PATH to PostgreSQL 9.3 bin and/or copying all DLLs from PostgreSQL to that 2.1 folder won't help

    • I have performed the uninstall - reinstall steps recommended from previous posts but this does not help either.

  15. Lars Kanis

    I just pushed the latest binary gems for Windows as pre-release on rubygems.org. You should be able to gem install pg --pre. If not, please open a new ticket.

  16. Log in to comment