Yardboy
Yardboy

Reputation: 2805

How do I make Ruby Gems installations on Windows use MinGW for making and compiling?

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.

Upvotes: 5

Views: 5098

Answers (5)

Charles Roper
Charles Roper

Reputation: 20625

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

Upvotes: 3

Luis Lavena
Luis Lavena

Reputation: 10378

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.

Upvotes: 1

Joe Soul-bringer
Joe Soul-bringer

Reputation: 3304

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).

Upvotes: 0

jakobengblom2
jakobengblom2

Reputation: 5888

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.

Upvotes: -1

Cameron McCloud
Cameron McCloud

Reputation:

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.

Upvotes: 1

Related Questions