views:

46

answers:

3

Hi there,

I'm trying to install some Gems and need to run the following command:

gem install mongrel mongrel_service mysql ruby-postgres oniguruma 
ultraviolet libxml-ruby --no-ri --no-rdoc --platform=mswin32

However, that --platform=mswin32 at the end of it bothers the hell out of me. I mean, my platform is x64 as it's supposed to be. When I remove the --platform=mswin32 from the command or replace mswin32 with mswin64, I get a long list of errors. Should I be concerned with --platform=mswin32 or just leave it alone and let it be? Thanks a lot in advance.

A: 

My idea was leave the "--platform=mswin32" alone and let it be. What happens then?

Daniel Chen
It installs fine. However, I'm not sure that "--platform=mswin32" is the right option.
UkraineTrain
When I erased it altogether, then at least mongrel, mongrel_service and mysql were installed correctly.
UkraineTrain
A: 

Hello

The platform option you're specifying is used to find pre-compiled binaries of the gems you're indicating.

But there has been no precompiled for mswin64. Even more, everything will depend in your Ruby installation if is or not a 64bits version.

Also, you forcing the platform could generate issues with gems that have been compiled for a different version of Ruby (1.8 versus 1.9) since they differ in API.

And don't forget, you need a compiler toolchain installed to be able to compile the gems that your platform do not support.

Luis Lavena
A: 

You really shouldn't be using the mswin32 versions of Ruby (aka. One-Click Installer). They are obsolete. They are compiled with Microsoft Visual C++ 6.0 (aka MSVC6), which was released in 1998(!). Code compiled with MSVC6 is incompatible with code compiled with both GCC and newer versions of MSVC. It is much slower, since a lot has happened in the area of compiler optimizations research in the last 12 years.

Because of the incompatibilities, all libraries that Ruby uses, all C extensions, all libraries that the C extensions use and so on, have to also be compiled with MSVC6. However, MSVC6 isn't even available anymore. Also, many open source projects only test for compatibility with GCC, not MSVC (and certainly not a version of MSVC that has been obsolete for almost a decade).

Use the mingw32 versions (aka. RubyInstaller) instead. They are compiled with GCC 3.4 or 4.5 (the (almost) latest version). With the optional DevKit, you can install any C extension, without the author of the gem having to provide a pre-compiled version; the gem just gets compiled on your local machine, just like it would under Linux or OSX.

However, that --platform=mswin32 at the end of it bothers the hell out of me. I mean, my platform is x64 as it's supposed to be.

Are you sure you have a 64 Bit build of Ruby? Like I wrote above, the mswin versions are usually compiled with MSVC6, which came out in 1998. AMD64 was only announced in 1999, the spec wasn't finished until 2000 and the first processors didn't appear until 2003, so, unless Microsoft has time-travel technology, it is simply impossible for a 64 Bit version of MSVC6 to even exist!

As far as I know, there are no pre-compiled versions of Ruby for 64 Bit Windows available. The RubyInstaller developers have only just started working on a 64 Bit mingw build.

If you compiled Ruby yourself, you should use --platform=ruby to force the Gems being compiled on you local system, since the pre-compiled mswin32 Gems which are available are all incompatible with your system, since they are a) 32 Bit and b) compiled with MSVC6 which is incompatible with whatever compiler you used.

Jörg W Mittag
Thanks a lot for this reply. It was very educational as to ruby's different configurations. However, --platform=ruby didn't work either. When I erased it altogether, then at least mongrel, mongrel_service and mysql were installed correctly.
UkraineTrain