views:

193

answers:

1

Hi

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.

+1  A: 

Hello,

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.

Luis Lavena
Thanks, I will try that.
Boris
Ok, I was able to install the gem, but it failed when I tried to require it. With the legacy one-click installer, I got a GemNotFoundException, when I tried to install the gem, even though I had added http://rubygems.org as a source. Do you have any idea why? In the meantime, I have solved my problem in another fashion, using a bat file with the start and taskkill commands.
Boris
Well, no, because you're not telling us what error you get. Basically if you're receiving an error, we need to know which one. If you're behind a proxy/firewall you need to use `--http-proxy` options. I believe you should search for that problem before posting a new question.
Luis Lavena