I have been using RubyGems 0.9.4 for quite a while, putting off upgrading to 1.* due to the problems it brings with building Gecode/R. The problem is that Gecode/R has a binary distribution with pre-compiled binaries for Windows. The binary distribution has to be marked with its platform to keep it separate from the source distributions. Before RubyGems 1.* this was done by setting the gemspec’s platform attribute as follows

spec.platform = Gem::Platform::WIN32

This however stopped working in 1.*, returning the following error message.

WIN32 has been removed, use CURRENT instead

All Gem::Platform:: constants other than RUBY and CURRENT were removed.

The RubyGems user documentation website hasn’t been updated since 0.8.7, so it isn’t easy to find information on why this change was made or how one should now build binary packages for platforms other than the host platform. Looking at the RubyGems source code however reveals that there is still some legacy support; one just has to avoid using the removed constants. The solution is to set the platform in the gemspec using

spec.platform = 'mswin32'

and things will be back to normal (until the legacy support is removed).

Sorry, comments are closed for this article.