Installing gem - C compiler issues (Win32)

K

Konrad Garus

Hello,

I've wasted quite some time on it and ran out of ideas, so I'm going to
ask here.

I have Ruby installed by the One-Click Installer. That works great. Now,
I need to install ferret. So I go to the command line and type "gem
install ferret". That's where the hell begins.

I have MinGW and VC8 (so-called 2005), and the installer seems to be
using the latter. Initially I'm getting some errors caused by includes
not being reachable, but that can be solved by copying them from VC to
where the installer looks for them. After that, I get like 100 errors
that basically look like compatibility issues...

Is it possible to make gem (ruby? rake?) use MinGW? Is it possible to
"manually" compile the C extensions with MinGW and then make gem use
them? Finally, is it possible to make it work with VC8?

(Ferret wiki says it needs VC6 which I don't have)

Simply speaking - how to make it work?

Regards,
Konrad Garus
 
A

ara.t.howard

Hello,

I've wasted quite some time on it and ran out of ideas, so I'm going to
ask here.

I have Ruby installed by the One-Click Installer. That works great. Now,
I need to install ferret. So I go to the command line and type "gem
install ferret". That's where the hell begins.

I have MinGW and VC8 (so-called 2005), and the installer seems to be
using the latter. Initially I'm getting some errors caused by includes
not being reachable, but that can be solved by copying them from VC to
where the installer looks for them. After that, I get like 100 errors
that basically look like compatibility issues...

Is it possible to make gem (ruby? rake?) use MinGW? Is it possible to
"manually" compile the C extensions with MinGW and then make gem use
them? Finally, is it possible to make it work with VC8?

(Ferret wiki says it needs VC6 which I don't have)

Simply speaking - how to make it work?

1) compile ruby under mingw
2) compile ferret or any libs you need under mingw
3) install any gem using the mingw ruby
4) manually copy libs into one-click-installer space or, alternatively, bundle
it up as a pre-compile gem.

i've done exactly this for the gsl and narray packages here

http://codeforpeople.com/lib/ruby/rb-gsl-win/rb-gsl-1.7.0/

in each case i solved #4 (getting from mingw compiled binaries into
one-click-installer space) by writing a tiny installer. for example

http://codeforpeople.com/lib/ruby/rb-gsl-win/rb-gsl-1.7.0/install.rb

which you'd run using the one-click-installer ruby

make sense?

-a
 
K

Konrad Garus

Thank you, I appreciate your help.

I'll give it a try, though it's much more work than I thought it'd need
(the bad thing is I need it on Windows).

Konrad
 
A

Ash

Thank you, I appreciate your help.

I'll give it a try, though it's much more work than I thought it'd need
(the bad thing is I need it on Windows).

Konrad

I've been in a similar situation before. When Ruby is compiled, it
records many of the compilation settings into a configuration file at
$RUBY_HOME/lib/ruby/i386-mswin32/rbconfig.rb, where $RUBY_HOME is the
Ruby installation directory and i386-mswin32 is your architecture.
When an extension is built, the generated Makefile uses all of these
settings. You can (carefully, backing up the original) edit settings
here to use the compiler, linker, and command-line options of your
choice for all of your gems.

Just be aware that the file will be blown away any time you re-install
or re-build Ruby (although in the latter case, you'd want to use the
new configuration it generates anyway).

</terrible-hack>
 
A

Austin Ziegler

I have MinGW and VC8 (so-called 2005), and the installer seems to be
using the latter.

It is not. It is using VC6. There's a difference, and you CANNOT
safely use VC8 with most libraries.

-austin
 
K

Konrad Garus

Thank you guys!

Using cygwin, I managed to compile ruby from sources and then install
ferret. My target was allinoneruby, and I failed to include it in the
package. But it should be fine for now to have it beside
allinoneruby.exe as long as it does the job.
 
A

ara.t.howard

Thank you guys!

Using cygwin, I managed to compile ruby from sources and then install
ferret. My target was allinoneruby, and I failed to include it in the
package. But it should be fine for now to have it beside
allinoneruby.exe as long as it does the job.

fwiw it's worth binaries created under mingw, iff possible, will be much
smaller!

-a
 
A

ara.t.howard

How do I ./configure with MinGW?

when you install mingw/msys this is precisely what you are installing: the
minimal set of tools required to type

./configure && make && make install



-a
 
R

Ryan Davis

It is not. It is using VC6. There's a difference, and you CANNOT
safely use VC8 with most libraries.

Austin, what is the current state of things in this land??

I periodically get bugs against image_science and parsetree from
windows users and I don't know what to tell them other than "things
suck right now for windows devs". Is there a place I could send them?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top