Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with Ruby 2.0.0 setup on x64 Windows #169

Closed
ged opened this issue Jul 25, 2013 · 8 comments
Closed

Doesn't work with Ruby 2.0.0 setup on x64 Windows #169

ged opened this issue Jul 25, 2013 · 8 comments

Comments

@ged
Copy link
Owner

ged commented Jul 25, 2013

Original report by Anonymous.


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 rubyinstaller.org 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?

Thanks.

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.

@ged
Copy link
Owner Author

ged commented Aug 2, 2013

Original comment by Lars Kanis (Bitbucket: larskanis, GitHub: larskanis).


It's a bug in bundler. It doesn't know anything about x64-mingw32. See also: rubygems/bundler#2356.

You can work around it by replacing 'x86-mingw32' to 'x64-mingw32' in Gemfile.lock and changing the platform list to the following:

PLATFORMS
  ruby
  x64-mingw32
  x86-mingw32

Now, bundle install should install the x64-gem of pg.

@ged
Copy link
Owner Author

ged commented Aug 3, 2013

Original comment by Lars Kanis (Bitbucket: larskanis, GitHub: larskanis).


Does the described workaround install the gems correctly for you?

@ged
Copy link
Owner Author

ged commented Aug 5, 2013

Original comment by Curtis Spendlove (Bitbucket: curtisspendlove, GitHub: curtisspendlove).


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.

@ged
Copy link
Owner Author

ged commented Aug 6, 2013

Original comment by Rasmus Schultz (Bitbucket: mindplaydk, ).


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.

@ged
Copy link
Owner Author

ged commented Aug 20, 2013

Original comment by Lars Kanis (Bitbucket: larskanis, GitHub: larskanis).


Support for the x64-mingw32 platform was merged to bundler and will be included in bundler version 1.4.0. I'll keep the issue open until then.

@ged
Copy link
Owner Author

ged commented Sep 3, 2013

Original comment by Lars Kanis (Bitbucket: larskanis, GitHub: larskanis).


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.

@ged
Copy link
Owner Author

ged commented Oct 4, 2013

Original comment by lozandier (Bitbucket: lozandier, GitHub: 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.

@ged
Copy link
Owner Author

ged commented Jan 6, 2014

Original comment by Lars Kanis (Bitbucket: larskanis, GitHub: larskanis).


Bundler-1.5.0 is out that solves this issue. Closing now.

@ged ged closed this as completed Jan 6, 2014
@ged ged added this to the Pending milestone Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant