Doesn't work with Ruby 2.0.0 setup on x64 Windows

Issue #169 resolved
Anonymous created an issue

I'm a Ruby newb, so go easy on me.

I grabbed the Ruby 2.0.0-p247 (x64) and DevKit-mingw64-64-4.7.2 distributions from and everything was fine - passed the json gem binary install test and all.

When I attempted to install the pg gem however, I ran into this issue which seems to stump a lot of new ruby users - there are many similar posts on stackoverflow and elsewhere.

Running bundle check everything appears to be fine, but when I look inside "Gemfile.lock", I see 0.16.0-x86-mingw32 where I expect I should be seeing 0.16.0-x64-mingw32?

The gem is installed and no tools (gem, bundle, etc.) ever complain about this issue - it only surfaces at run-time, when, seemingly, the pg gem simply gets skipped without any notice, warning or error. (which in itself is creepy, but probably has nothing to do with the pg gem as such?)

After half a day of googling and trying to different things, nothing helps, and I finally went and ditched my 64-bit ruby environment, and set up a new 32-bit environment. It doesn't feel right, running a 32-bit environment on a nice fast 64-bit machine, but whatever works, I suppose.

Anyhow, do you think this is a problem with the pg gem, with gem itself, with bundler, or even with the ruby or devkit distribution?

As mentioned, I was able to build and run the json binary gem, so it seems like at least ruby and devkit must be working.

From my limited understanding of gem and bundler, either of those could potentially be at fault, but I'm hoping you can answer that question better than I?


PS: my installed version is 0.16.0, not 0.15.0, but there was no option for that in the Version dropdown on this form.

Comments (11)

  1. Curtis Spendlove

    This worked correctly for me. I also utilized the trick for 'ffi' and a couple other gems that seem to be effected by the same bug. Thanks, this was driving me nuts.

    Incidentally, all associated commands such as "bundle show pg" return proper results.

  2. Rasmus Schultz

    I don't know - after 15 hours of fighting with my Windows Ruby setup, I gave up, for the third time over the past five years or so. I finally had enough of fighting binary dependencies and system environment issues - I installed JRuby instead, which has worked flawlessly so far.

  3. Lars Kanis

    gem inst bundler --pre should install version 1.4.0.pre.2, that should solve the issue for pg.gem. Unfortunately there are many other gems out there that are not prepared for ruby-2.0.0 on Windows.

  4. lozandier

    You can install the 64-bit version of PG without Bundler 1.4 for weeks at least;

    You need a cross-compiled version ready to be built and pass in the optios --with-opt-dir that leads to the where it is.

    Google "Knapsack".

    As for Bundler 1.4; I've had issues regarding github repositories being referred by required gems in the Gemfile to be of use for me at the moment.

    Having that said, you will still be stuck by Nokogiri regarding Rails 4 development w/ Ruby 2.0 x64 towards being able to start the app.

  5. Log in to comment