views:

1380

answers:

5

Trying to update some gems on a Windows machine and I continually get this error output for gems that do not have pre-compiled binaries:

Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --srcdir=. --curdir --ruby=c:/server/ruby/bin/ruby

These are configuration options that are provided to the extconf.rb ruby file during the installation of the gem.

I have installed MinGW so I should have everything I need to install, make and compile these gems. However, I do not know how to change the configuration for RubyGems so that when extconf.rb is called it includes the appropriate options pointing to the MinGW include directory.

+1  A: 

I don't know if this works with the native Windows Ruby, but if you use the Cygwin version and have a full Cygwin installed (compilers etc) then you shouldn't have any problems - we've been able to use a lot of gems that require compiled stuff.

+2  A: 

There's a DevKit that could well be what you're after.

Charles Roper
Thanks - I was not aware until reading this that the gems need to be compiled with the same compiler used for the Ruby language itself. That being the case, I have gone the other way - I've installed VC6 and with one minor code addition to a header file, everything works just fine. Thanks.
Yardboy
A: 

In general, in my experience, code designed for a unix system can be very hard to make work on MinGW. For a quick port, use CygWin. Or do a full port of the software to Windows host, including using native windows shell and OS API -- which is pretty darn expensive in terms of time, but it pays of if you plan to support Windows long term.

Not familiar with this particular software package, this is just a general observation on trying to port some other dastardly pieces of code to Windows.

jakobengblom2
A: 

I had just the same problem.

The only way I found to get gems that did not have pre-compiled binaries - such as parsetree - to run on windows was to recompile the Ruby source using Mingw as well as copy several libraries and applications from the visual c++ install I already had. What I copied included the zlib library as well as the iconv library and application.

Note: I am using this setup as a test configuration. I would not use such a setup for production (since who knows what happens when you a library from one distribution to another).

Joe Soul-bringer
A: 

Yardboy,

Too bad you didn't mention which gem are you trying to update, you only put there the options output.

Also, some of these gems needs development headers and libraries, not just the compiler (MinGW).

Plus, MinGW is going to work as long the Ruby build you have is created with MinGW.

There is some work being done to ease this, but compiler, headers and library requirements are needed on all the platforms, not just Windows.

You can find more info and resources on my blog

Cheers.

Luis Lavena