Loading `pg` on Windows Ruby 2.3.0 fails

Issue #238 resolved
Looi FY
created an issue

RubyInstaller just released Ruby 2.3.0 for Windows. Was able to install and compile pg without problems, but execution fails with the following error:

C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/pg-0.18.4-x64-mingw32/lib/pg.rb:14:in require': cannot load such file -- 2.3/pg_ext (LoadError)

Looks like pg '0.18.4' does not have lib/2.3/pg_ext.so yet. /2.0/pg_ext.so, /2.1/pg_ext.so and /2.2/pg_ext.so are present.

Comments (19)

  1. Francesco Loreti

    I had an error with libpq-fe.h . I have resolved the installation with:

    subst X: "C:\Program Files\PostgreSQL\9.5"
    gem install pg --pre -- with-pg=X:
    subst X: /D
    gem list pg
    pg (0.19.0.pre20160409114042, 0.18.4 x64-mingw32)
    

    But Now I have your previous error:

    C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/pg-0.19.0.pre20160409114042/lib/pg.rb:14:in `require': cannot load such file -- 2.3/pg_ext (LoadError)
    
  2. Francesco Loreti

    When I have installed 0.18.4 and 0.19 gem and I open the pg.rb file I read 2 differents:

    On 0.18.4 row 13

    ENV['PATH'] = "#{File.expand_path("../#{RUBY_PLATFORM}", __FILE__)};#{old_path}"
    

    On 0.19 row 13

    ENV['PATH'] = "#{File.expand_path("..", __FILE__)};#{old_path}"
    

    And 0.18.4 on row 27

    VERSION = '0.18.4'
    

    And into 0.19 row 27

    VERSION = '0.18.4'
    
  3. Francesco Loreti

    I put the "C:\Program Files\PostgreSQL\9.5\bin" into PATH. In "C:\Program Files\PostgreSQL\9.5\bin" there are pg_config.exe and libpq.dll but I have same error. Are You sure that you have same configuration: Windows 10 x64 / PG 9.5 / Ruby 2.3 / Rails 5 beta3 (and now rc1)?

  4. kadukia

    @Michael Charlton, I am noticing below error on Windows 10, Ruby 2.3.3 None of the above solutions worked.

    bundle exec rake db:migrate rake aborted! LoadError: cannot load such file -- 2.3/pg_ext

    Any help is highly appreciated.

  5. Log in to comment