How to change rubygems platform from x86-mingw32 to x86-mswin32-60 on windows

Boris picture Boris · Jul 17, 2010 · Viewed 7.5k times · Source

I am doing some ruby scripting in windows, which involves opening and closing a browser. To that end I needed some special gems to interface to the native windows system calls. But when I tried

> gem install sys-proctable

, it yielded

ERROR: Could not find a valid gem ´sys-proctable´ (>= 0), here is why: 
          Found sys-proctable (0.9.0), but was for platforms x86-darwin-8 
            ,x86-freebsd-7 ,x86-solaris-2.10 ,x86-linux ,x86-mswin32-60

The problem is that my gem installation does not have the x86-mswin32-60 rubygems platform

> gem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.7
  - RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [i386-mingw32]

  ...

  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-mingw32

  ...

It seems that the problem comes from my version of ruby being compiled with mingw libraries. So my question is: how can I get a version of ruby, where rubygems platforms include x86-mswin32-60? I cannot find any installers from rubyinstaller.org which are not mingw.

--- edit ---

That last part was a bit hasty. Actually, rubyinstaller.org has the legacy one-click installers, which were built for mswin32. But that install had some other problems for me, so I guess I will try the solution from Luis below.

Answer

Luis Lavena picture Luis Lavena · Jul 18, 2010

You can force the gem installation specifying --platform option:

gem install sys-proctable --platform=x86-mswin32-60

However, I advise against it for several reasons, some I've mentioned in my blog here

Please test first and see if it will work before pushing a code that is based on this into a production environment.

Hope that helps.