[Rubygems-developers] Questions about Gem Platform Matching

Luis Lavena luislavena at gmail.com
Fri Sep 28 19:40:18 EDT 2007

On 9/28/07, Eric Hodel <drbrain at segment7.net> wrote:
> On Sep 27, 2007, at 18:39 , Luis Lavena wrote:
> >
> > Should the version for mswin32 (current nil) be used for this case?
> Probably.  Is there a way to get the value out of Config::CONFIG?

# Ruby built with VC6 (official) 1.8.6-p110
irb(main):005:0> Config::CONFIG['arch']
=> "i386-mswin32"

=> "msvcrt-ruby18.dll"

# Ruby built with VC8 (which is supported) 1.8.6-p110
irb(main):004:0> Config::CONFIG['arch']
=> "i386-mswin32_80"

=> "msvcr80-ruby18.dll"


As you can see, both libruby are different, so this could raise the
problem I stated about gems build with VC6 and using ruby build with

Using the matcher found in your article about Lazyweb ;-)

I gather this information:

ruby 1.8.6 (2007-09-23 patchlevel 110) [i386-mswin32]
Your cpu is:   "i386"
Your os is:    "mswin32"
Your platform is: "x86-mswin32"

ruby 1.8.6 (2007-09-23 patchlevel 110) [i386-mswin32_80]
Your cpu is:   "i386"
Your os is:    "mswin32_80"
Your platform is: "x86-mswin32"

The OS defines which version of runtime is needed/used.

Changing the case line:

  when /mswin32(\_(\d+))?/ then    [ 'mswin32',   $2  ]

Works around the problem.

Also, to be noted:

Gem::Platform.local will report 'i386-mswin32_80' since is what
Config::CONFIG['arch'] have for ruby build with VC8... and that
differs from VC6...

I'm working on a patch and checking the tests cases.

Luis Lavena
Multimedia systems
Leaders are made, they are not born. They are made by hard effort,
which is the price which all of us must pay to achieve any goal that
is worthwhile.
Vince Lombardi

More information about the Rubygems-developers mailing list