Finding ruby.h

J

John Ky

[Note: parts of this message were removed to make it a legal post.]

Hi,

I'm building ruby extensions across many different OSes and architectures.

Does anyone know an easy way to find ruby.h on any given system?

I'm told that perl has a "perl -V" or @ENV variable which gives some paths I
can look through for perl.h.

Does Ruby have an equivalent? Is there a better way to find ruby.h?

Thanks,

-John
 
J

Jeremy Hinegardner

Hi,

I'm building ruby extensions across many different OSes and architectures.

Does anyone know an easy way to find ruby.h on any given system?

I'm told that perl has a "perl -V" or @ENV variable which gives some paths I
can look through for perl.h.

Does Ruby have an equivalent? Is there a better way to find ruby.h?

This works on a couple of my systems:

require 'rbconfig'
loc = File.join( Config::CONFIG['archdir'], 'ruby.h')
if File.exist?( loc ) then
puts loc
else
puts "Unable to find ruby.h in #{loc}"
end

enjoy,

-jeremy
 
L

LaP

John Ky a écrit :
I'm building ruby extensions across many different OSes and architectures.

Does anyone know an easy way to find ruby.h on any given system?

I'm told that perl has a "perl -V" or @ENV variable which gives some paths I
can look through for perl.h.

Does Ruby have an equivalent? Is there a better way to find ruby.h?

My first idea for this kind of problem would be to check GNU autoconf /
configure.sh

LaP
 
J

John Ky

[Note: parts of this message were removed to make it a legal post.]

Hi all,

Thanks everyone for your help. I've settled with this solution as I've
already got it working. Very much appreciated!

-John

Hi,

I'm building ruby extensions across many different OSes and architectures.

Does anyone know an easy way to find ruby.h on any given system?

I'm told that perl has a "perl -V" or @ENV variable which gives some paths I
can look through for perl.h.

Does Ruby have an equivalent? Is there a better way to find ruby.h?

This works on a couple of my systems:

require 'rbconfig'
loc = File.join( Config::CONFIG['archdir'], 'ruby.h')
if File.exist?( loc ) then
puts loc
else
puts "Unable to find ruby.h in #{loc}"
end

enjoy,

-jeremy
 

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

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top