Ruby 2.0 / Bundler issues on Windows


#1

Ohai Chefs,

might be a bit off-topic, but maybe you have the Ruby Fu to help me out
here.

The issue: Ruby 2.0 changed its ABI (Application Binary Interface) and now
any pre-compiled native gems for the mswin/mingw platforms don’t work
anymore. The obvious fix is to use the devkit and install the gems with the
--platform=ruby flag.

That works fine for gem install xyz --platform=ruby but does not when
using Bundler (i.e. bundle install): there is (afaik) no possibility to
pass the --platform=ruby to bundler and thus it will prefer the
precompiled native gems if available. If they were compiled against Ruby
1.9 things are breaking…

Question: do you have any solution to force bundler install with the
--platform flag? How can we poor windows fellows handle this?

Btw: Vagrant changed to Ruby 2.0 a while ago, I suspect Omnibus will soon
ship with Ruby 2.0 too?

Cheers,
Torben


#2

On Friday, March 21, 2014 at 3:43 AM, Torben Knerr wrote:

Ohai Chefs,

might be a bit off-topic, but maybe you have the Ruby Fu to help me out here.

The issue: Ruby 2.0 changed its ABI (Application Binary Interface) and now any pre-compiled native gems for the mswin/mingw platforms don’t work anymore. The obvious fix is to use the devkit and install the gems with the --platform=ruby flag.

That works fine for gem install xyz --platform=ruby but does not when using Bundler (i.e. bundle install): there is (afaik) no possibility to pass the --platform=ruby to bundler and thus it will prefer the precompiled native gems if available. If they were compiled against Ruby 1.9 things are breaking…

Question: do you have any solution to force bundler install with the --platform flag? How can we poor windows fellows handle this?

Btw: Vagrant changed to Ruby 2.0 a while ago, I suspect Omnibus will soon ship with Ruby 2.0 too?

Cheers,
Torben

From a quick googling, it appears that bundler doesn’t support this.

As for your Omnibus question, issues with ABI versions and precompiled gems on windows are the main reason we haven’t updated yet. We haven’t recently tested whether Chef’s dependencies have been updated with Ruby 2.0 compatible native code, but as of a few months ago, they had not.


Daniel DeLeo


#3

On 3/21/14 3:43 AM, Torben Knerr wrote:

Btw: Vagrant changed to Ruby 2.0 a while ago, I suspect Omnibus will
soon ship with Ruby 2.0 too?

ChefDK is being built with Ruby 2.1.1 right now. Chef 12 will also ship
with whatever is latest, modulo any issues that crop up on windows, etc.

So far we haven’t found anything hard requirements driving us to ruby >=
2.0, but with the major version bump we’ll take the opportunity to bump
the ruby to the latest version that makes sense.

Right now we suggest using the Ruby 1.9 that comes in the MSI rather
than trying to do the work yourself.