Cannot find pg_ext using pg 0.16.0 on Ubuntu12.04 Ruby 2.0.0

Issue #172 resolved
Gene Black created an issue

After installing the pg gem on ubuntu 12.04 x86-64 using Ruby 2.0.0 (aws ec2) I receive an error when rake db:migrate runs stating it is unable to find the library. This only occurs on Ruby 2.0.0, Ruby 1.9.1 works fine. The locations for pg.rb and under Ruby 2.0.0 follow:



Here is the logged error (running under chef 0.9)

cannot load such file -- pg_ext /home/deploy/.bundler/naip/ruby/2.0.0/gems/pg-0.16.0/lib/pg.rb:4:in require' /home/deploy/.bundler/naip/ruby/2.0.0/gems/pg-0.16.0/lib/pg.rb:4:in<top (required)>' /srv/www/naip/releases/20130913161937/config/application.rb:7:in <top (required)>' /srv/www/naip/releases/20130913161937/Rakefile:5:inrequire' /srv/www/naip/releases/20130913161937/Rakefile:5:in `<top (required)>'

Ruby 1.9.1 file locations are:



Comments (5)

  1. Lars Kanis

    Thanks @geblack for the detailed report! Unfortunately I'm not able to reproduce it, so far.

    To track the issue down, it would help if you could tar and attach the contents of /home/deploy/.bundler/naip/ruby/2.0.0/gems/pg-0.16.0 . Maybe it is also possible to run env MAKE="make V=1" gem install pg --verbose and post the output here. And which is your exact ruby --version ? I guess it's installed to /usr/local/lib/ruby, isn't it?

  2. Gene Black reporter

    Seems to work fine when installing under rvm but not when installing via chef 0.9 in aws opsworks.

    Its looking more like an environment issue but unsure how the environment is affecting the gem install in this way.

    Realizing that this is probably an environment issue I appreciate any help you might be able to provide but realize that recreating the issue in this unique environment may be impossible.

  3. Gene Black reporter

    OK, after upgrading bundler and rubygems to a later release it appears to be working. The versions that I was using were targeting ruby-1.9.3 so apparently were not compatible with ruby-2.0.0.

    Sorry for the distraction, I should have checked that out first.

    original versions: bundler-1.2.3 rubygems-1.8.24

    working versions: bundler-1.3.5 rubygems-2.0.3

    As a side note I also had to upgrade the passenger gem version after updating rubygems and bundler from passenger 3.0.17 => 4.0.1

  4. Lars Kanis

    Using ruby-2.0.0 with rubygems-1.8.24 is probably a bad idea - that sounds to me like the root cause for the install issue. Thank you for posting your solution, this could help on issue #168.

  5. Log in to comment