# 'gem update' making wrong choice

**URL:** <https://www.ruby-forum.com/t/gem-update-making-wrong-choice/121070>\
**Category:** Ruby\
**Created:** [November 23, 2007, 1:48pm UTC](https://www.ruby-forum.com/t/gem-update-making-wrong-choice/121070 "2007-11-23T13:48:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![micheldogger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b5e925/32.png) [@micheldogger](https://www.ruby-forum.com/u/micheldogger)\
**Post date:** [November 23, 2007, 1:48pm UTC](https://www.ruby-forum.com/t/gem-update-making-wrong-choice/121070/1 "2007-11-23T13:48:03Z")

</div>

I work on a Win box, without compiler.  
But ‘gem environment’ gives two PLATFORMs, win32 _and_ ruby.  
Then ‘gem update’ try to load the wrong gem…

How may I clean the environment variable ?  
Thanks for help…

---

<div class="post-metadata">

**Author:** ![micheldogger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b5e925/32.png) [@micheldogger](https://www.ruby-forum.com/u/micheldogger)\
**Post date:** [November 23, 2007, 6:00pm UTC](https://www.ruby-forum.com/t/gem-update-making-wrong-choice/121070/2 "2007-11-23T18:00:33Z")

</div>

On Nov 23, 9:48 am, Michel D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I work on a Win box, without compiler.  
> But ‘gem environment’ gives two PLATFORMs, win32 _and_ ruby.  
> Then ‘gem update’ try to load the wrong gem…
> 
> How may I clean the environment variable ?  
> Thanks for help…

I don’t think understand your problem.

gem env reports two platforms: that is correct: take for example this  
linux box:

RubyGems Environment:

- RUBYGEMS VERSION: 0.9.5 (0.9.5)
- RUBY VERSION: 1.8.6 (2007-09-24 patchlevel 111) [i686-linux]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /usr/local/bin/ruby
- RUBYGEMS PLATFORMS:
  - ruby
  - x86-linux

- GEM PATHS:
  - /usr/local/lib/ruby/gems/1.8

That means rubygems will try to install gems marked with ‘ruby’ (also  
known as pure ruby gems) or gems that are pre-compiled / binary or  
specific for the x86 linux platform.

In your case, x86-mswin32 is a correct platform and RubyGems will try  
to install the best gems for you.

What is the output you’re having?  
More information will be helpful to point directions or bug reports.

---

<div class="post-metadata">

**Author:** ![micheldogger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b5e925/32.png) [@micheldogger](https://www.ruby-forum.com/u/micheldogger)\
**Post date:** [November 23, 2007, 6:19pm UTC](https://www.ruby-forum.com/t/gem-update-making-wrong-choice/121070/3 "2007-11-23T18:19:42Z")

</div>

Luis L. wrote:

> On Nov 23, 9:48 am, Michel D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > I work on a Win box, without compiler.  
> > But ‘gem environment’ gives two PLATFORMs, win32 _and_ ruby.  
> > Then ‘gem update’ try to load the wrong gem…
> > 
> > How may I clean the environment variable ?  
> > Thanks for help…
> 
> I don’t think understand your problem.
> 
> gem env reports two platforms: that is correct: take for example this  
> linux box:
> 
> RubyGems Environment:
> 
> - RUBYGEMS VERSION: 0.9.5 (0.9.5)
> - RUBY VERSION: 1.8.6 (2007-09-24 patchlevel 111) [i686-linux]
> - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8
> - RUBY EXECUTABLE: /usr/local/bin/ruby
> - RUBYGEMS PLATFORMS:
> - ruby
> - x86-linux
> 
> - GEM PATHS:
> - /usr/local/lib/ruby/gems/1.8
> 
> That means rubygems will try to install gems marked with ‘ruby’ (also  
> known as pure ruby gems) or gems that are pre-compiled / binary or  
> specific for the x86 linux platform.
> 
> In your case, x86-mswin32 is a correct platform and RubyGems will try  
> to install the best gems for you.
> 
> What is the output you’re having?  
> More information will be helpful to point directions or bug reports.

@Luis  
Apparently, ‘gem install’ selects the wrong gem and loads a gem to be  
compiled, see below :  
This is new to gem 0.9.5, before I had to choose…

Microsoft Windows XP [version 5.1.2600]  
(C) Copyright 1985-2001 Microsoft Corp.

C:…\>gem install rcov  
Building native extensions. This could take a while…  
ERROR: Error installing rcov:  
ERROR: Failed to build gem native extension.

C:/ruby/bin/ruby.exe extconf.rb install rcov  
creating Makefile

nmake  
‘nmake’ n’est pas reconnu en tant que commande interne  
ou externe, un programme exÃ©cutable ou un fichier de commandes.  
Gem files will remain installed in  
C:/ruby/lib/ruby/gems/1.8/gems/rcov-0.8.1.2.0  
for inspection.  
Results logged to  
C:/ruby/lib/ruby/gems/1.8/gems/rcov-0.8.1.2.0/ext/rcovrt/gem\_m  
ake.out

---

<div class="post-metadata">

**Author:** ![micheldogger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b5e925/32.png) [@micheldogger](https://www.ruby-forum.com/u/micheldogger)\
**Post date:** [November 23, 2007, 6:26pm UTC](https://www.ruby-forum.com/t/gem-update-making-wrong-choice/121070/4 "2007-11-23T18:26:37Z")

</div>

Michel D. wrote:

> Luis L. wrote:
> 
> > On Nov 23, 9:48 am, Michel D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> > 
> > > I work on a Win box, without compiler.  
> > > But ‘gem environment’ gives two PLATFORMs, win32 _and_ ruby.  
> > > Then ‘gem update’ try to load the wrong gem…
> > > 
> > > How may I clean the environment variable ?  
> > > Thanks for help…
> > 
> > I don’t think understand your problem.
> > 
> > gem env reports two platforms: that is correct: take for example this  
> > linux box:
> > 
> > RubyGems Environment:
> > 
> > - RUBYGEMS VERSION: 0.9.5 (0.9.5)
> > - RUBY VERSION: 1.8.6 (2007-09-24 patchlevel 111) [i686-linux]
> > - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8
> > - RUBY EXECUTABLE: /usr/local/bin/ruby
> > - RUBYGEMS PLATFORMS:
> > - ruby
> > - x86-linux
> > 
> > - GEM PATHS:
> > - /usr/local/lib/ruby/gems/1.8
> > 
> > That means rubygems will try to install gems marked with ‘ruby’ (also  
> > known as pure ruby gems) or gems that are pre-compiled / binary or  
> > specific for the x86 linux platform.
> > 
> > In your case, x86-mswin32 is a correct platform and RubyGems will try  
> > to install the best gems for you.
> > 
> > What is the output you’re having?  
> > More information will be helpful to point directions or bug reports.
> 
> @Luis  
> Apparently, ‘gem install’ selects the wrong gem and loads a gem to be  
> compiled, see below :  
> This is new to gem 0.9.5, before I had to choose…
> 
> Microsoft Windows XP [version 5.1.2600]  
> (C) Copyright 1985-2001 Microsoft Corp.
> 
> C:…\>gem install rcov  
> Building native extensions. This could take a while…  
> ERROR: Error installing rcov:  
> ERROR: Failed to build gem native extension.
> 
> C:/ruby/bin/ruby.exe extconf.rb install rcov  
> creating Makefile
> 
> nmake  
> ‘nmake’ n’est pas reconnu en tant que commande interne  
> ou externe, un programme exÃ©cutable ou un fichier de commandes.  
> Gem files will remain installed in  
> C:/ruby/lib/ruby/gems/1.8/gems/rcov-0.8.1.2.0  
> for inspection.  
> Results logged to  
> C:/ruby/lib/ruby/gems/1.8/gems/rcov-0.8.1.2.0/ext/rcovrt/gem\_m  
> ake.out

More to be complete :

RubyGems Environment:

- RUBYGEMS VERSION: 0.9.5 (0.9.5)
- RUBY VERSION: 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]
- INSTALLATION DIRECTORY: C:/ruby/lib/ruby/gems/1.8
- RUBY EXECUTABLE: C:/ruby/bin/ruby.exe
- RUBYGEMS PLATFORMS:
  - ruby
  - x86-mswin32-60

- GEM PATHS:
  - C:/ruby/lib/ruby/gems/1.8

- GEM CONFIGURATION:
  - :update\_sources =\> true
  - :verbose =\> true
  - :benchmark =\> false
  - :backtrace =\> false
  - :bulk\_threshold =\> 1000

- REMOTE SOURCES:
  - [http://gems.rubyforge.org](http://gems.rubyforge.org)

---

<div class="post-metadata">

**Author:** ![micheldogger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b5e925/32.png) [@micheldogger](https://www.ruby-forum.com/u/micheldogger)\
**Post date:** [November 23, 2007, 8:08pm UTC](https://www.ruby-forum.com/t/gem-update-making-wrong-choice/121070/5 "2007-11-23T20:08:24Z")

</div>

On Nov 23, 2:19 pm, Michel D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > ```
> > - x86-linux
> > 
> > ```
> > 
> > What is the output you’re having?  
> > More information will be helpful to point directions or bug reports.
> 
> @Luis  
> Apparently, ‘gem install’ selects the wrong gem and loads a gem to be  
> compiled, see below :  
> This is new to gem 0.9.5, before I had to choose…

Yes Michel, this was reported and solved for gems marked as ‘mswin32’  
platform which extend to mongrel, rcov and others.

This problem was discussed on RubyGems development list and this was  
fixed in the repository. I guess RubyGems developers are waiting for  
more feedback until drop 0.9.5.1 bugfix release.

I’ll suggest checkout the repository trunk of RubyGems [1] and perform  
the install manually.

I must agree this should have rolled sooner, but catching all the odd  
cases with so many platforms is a hard task.

Also, this is a mistake that gem developers used ‘mswin32’ instead of  
using Gem::Platform::CURRENT (almost all, including me).

You can overide that for the time being with:

gem update --platform ‘mswin32’

Maybe now 0.9.5 is out, we should start creating _correct_ packages  
for it?

[1] [http://rubyforge.org/scm/?group\_id=126](http://rubyforge.org/scm/?group_id=126)

---

<div class="post-metadata">

**Author:** ![micheldogger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b5e925/32.png) [@micheldogger](https://www.ruby-forum.com/u/micheldogger)\
**Post date:** [November 23, 2007, 8:33pm UTC](https://www.ruby-forum.com/t/gem-update-making-wrong-choice/121070/6 "2007-11-23T20:33:03Z")

</div>

Luis L. wrote:

> Also, this is a mistake that gem developers used ‘mswin32’ instead of  
> using Gem::Platform::CURRENT (almost all, including me).
> 
> You can overide that for the time being with:
> 
> gem update --platform ‘mswin32’
> 
> Maybe now 0.9.5 is out, we should start creating _correct_ packages  
> for it?
> 
> [1] [http://rubyforge.org/scm/?group\_id=126](http://rubyforge.org/scm/?group_id=126)

Thanks a lot, Luis. I tried the “correct” form --platform x86-win32-60  
and it did not work. I understand now why…

All the best  
Michel

---

<div class="post-metadata">

**Author:** ![micheldogger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b5e925/32.png) [@micheldogger](https://www.ruby-forum.com/u/micheldogger)\
**Post date:** [November 23, 2007, 11:21pm UTC](https://www.ruby-forum.com/t/gem-update-making-wrong-choice/121070/7 "2007-11-23T23:21:50Z")

</div>

> > [1] [http://rubyforge.org/scm/?group\_id=126](http://rubyforge.org/scm/?group_id=126)
> 
> Thanks a lot, Luis. I tried the “correct” form --platform x86-win32-60  
> and it did not work. I understand now why…

Just out of curiousity, how many incorrect options are there? Is this  
totally idiot-proof in the new version? I’d be up to write a

gem help windows

docs patch with some simple overview of stuff like that, except my  
Windows box is in storage. Deep storage. Practically cryogenic.

–  
Giles B.

Podcast: [http://hollywoodgrit.blogspot.com](http://hollywoodgrit.blogspot.com)  
Blog: [http://gilesbowkett.blogspot.com](http://gilesbowkett.blogspot.com)  
Portfolio: [http://www.gilesgoatboy.org](http://www.gilesgoatboy.org)  
Tumblelog: [http://giles.tumblr.com](http://giles.tumblr.com)

---

<div class="post-metadata">

**Author:** ![micheldogger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b5e925/32.png) [@micheldogger](https://www.ruby-forum.com/u/micheldogger)\
**Post date:** [November 28, 2007, 5:48am UTC](https://www.ruby-forum.com/t/gem-update-making-wrong-choice/121070/8 "2007-11-28T05:48:27Z")

</div>

On Nov 23, 2007, at 11:05 AM, Luis L. wrote:

> Maybe now 0.9.5 is out, we should start creating _correct_ packages  
> for it?

Gems with string platforms can no longer be built on 0.9.5. The  
author will need to make changes to the gemspec, and the exception  
given should be straightforward.

---

<div class="post-metadata">

**Author:** ![micheldogger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b5e925/32.png) [@micheldogger](https://www.ruby-forum.com/u/micheldogger)\
**Post date:** [November 28, 2007, 5:51am UTC](https://www.ruby-forum.com/t/gem-update-making-wrong-choice/121070/9 "2007-11-28T05:51:23Z")

</div>

On Nov 23, 2007, at 14:20 PM, Giles B. wrote:

> Just out of curiousity, how many incorrect options are there? Is this  
> totally idiot-proof in the new version? I’d be up to write a
> 
> gem help windows
> 
> docs patch with some simple overview of stuff like that, except my  
> Windows box is in storage. Deep storage. Practically cryogenic.

$ gem help platforms  
[…]  
When building platform gems, set the platform in the gem specification  
to  
Gem::Platform::CURRENT. This will correctly mark the gem with your  
ruby’s  
platform.

Is that good enough?
