Ruby Header Files in Mac OS X

[Snow-iMac:~/Desktop/Programming/rubyforger] ari% ruby extconf.rb
can’t find header files for ruby.

Am I the only one having this issue? I have found ruby.h (assuming
that’s the file it’s looking for), and it’s in the normal directory.
I have had this issue every time I try to install a new Ruby library.

I suppose ruby.h is not the file it’s looking for?

Thanks,
Ari
--------------------------------------------|
If you’re not living on the edge,
then you’re just wasting space.

On 24/05/2007, at 8:19 AM, Ari B. wrote:

[Snow-iMac:~/Desktop/Programming/rubyforger] ari% ruby extconf.rb
can’t find header files for ruby.

Am I the only one having this issue? I have found ruby.h (assuming
that’s the file it’s looking for), and it’s in the normal
directory. I have had this issue every time I try to install a new
Ruby library.

I suppose ruby.h is not the file it’s looking for?

Have you set up your paths correctly?

$ whereis ruby
/usr/bin/ruby
$ echo $PATH
/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/bin:/sbin:/usr/
bin:/usr/sbin

The path to ruby should be in your $PATH

On May 23, 2007, at 4:51 PM, Henry M. wrote:

I suppose ruby.h is not the file it’s looking for?

Have you set up your paths correctly?

$ whereis ruby
/usr/bin/ruby
$ echo $PATH
/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/bin:/sbin:/usr/
bin:/usr/sbin

I can run ruby just fine, but to be sure, I checked. And yup, Ruby’s
in my path.

Sweet Ruby Gods please help me
~ Ari
English is like a pseudo-random number generator - there are a
bajillion rules to it, but nobody cares.

Ari B. wrote:

Sweet Ruby Gods please help me

You’re running the version of Ruby that comes pre-installed with OS X,
right? Apple got the header files installed in the wrong location. Your
best bet is to install your own version of Ruby in /usr/local.

Ari B. wrote:

Couldn’t I just move the file around? And should I reinstall it in
/usr/bin or /usr/local?

You could, but installing your own version of Ruby is easy and you can
keep up with new releases. Not to mention you become the master of your
own destiny, at least as far as Ruby is concerned :slight_smile:

You should install it in /usr/local and then modify your PATH to put
/usr/local in front. Put this in your ~/.profile file:

export PATH=/usr/local:$PATH

You can learn about PATH and .profile by issuing the “man bash” command
in a Terminal window, or just Google it.

On 24/05/2007, at 10:09 AM, Ari B. wrote:

You’re running the version of Ruby that comes pre-installed with
OS X, right? Apple got the header files installed in the wrong
location. Your best bet is to install your own version of Ruby in /
usr/local.

Couldn’t I just move the file around? And should I reinstall it in /
usr/bin or /usr/local?

By installing your own version of ruby you can be reasonably sure
that everything will be correct. If you start mucking about with the
existing version you might break something and never be able to fix
it without re-installing.

Anyway…

It’s not one file it’s directory that is in the wrong place. Where is
your ruby currently residing? If it is /usr/bin then check in /usr/
lib to see if there is a ruby directory.

On May 23, 2007, at 5:40 PM, Tim H. wrote:

Ari B. wrote:

Sweet Ruby Gods please help me

You’re running the version of Ruby that comes pre-installed with OS
X, right? Apple got the header files installed in the wrong
location. Your best bet is to install your own version of Ruby in /
usr/local.

Couldn’t I just move the file around? And should I reinstall it in /
usr/bin or /usr/local?

Thank you. I will frame this email.
-------------------------------------------|
Nietzsche is my copilot

On 24/05/2007, at 10:21 AM, Tim H. wrote:

Ari B. wrote:

Couldn’t I just move the file around? And should I reinstall it
in /usr/bin or /usr/local?

You can learn about PATH and .profile by issuing the “man bash”
command in a Terminal window, or just Google it.

or try…

Henry M. wrote:

On 24/05/2007, at 10:21 AM, Tim H. wrote:

Ari B. wrote:

Couldn’t I just move the file around? And should I reinstall it
in /usr/bin or /usr/local?

You can learn about PATH and .profile by issuing the “man bash”
command in a Terminal window, or just Google it.

or try…

Dan Benjamin

You can have it even easier.
Install macports ( http://www.macports.org/ )
Then in the shell: sudo port install ruby

→ be happy

Ok everyone - it worked. Thanks everyone for helping me through this
issue. It was like the midlife crisis of my teens.

BUT when I tried to change my path, it didn’t work. I’m using tcsh,
and am doing two things:
setting my path directly through the command line:
setenv PATH /usr/local/bin/:$PATH

and through /private/etc/csh.cshrc
I am adding setenv PATH /usr/local/bin/:$PATH to the end of the file
and saving it.

Huh?
Out of the frying pan and into the fire. Well, at least onto a rather
hot surface.
--------------------------------------------|
If you’re not living on the edge,
then you’re just wasting space.

and through /private/etc/csh.cshrc
I am adding setenv PATH /usr/local/bin/:$PATH to the end of
the file and saving it.

I could be wrong, but I believe that csh needs the variable to be in the
form of ${var}, e.g. ${PATH}

Or at least that’s always how I’ve done it.

You’re running the version of Ruby that comes pre-installed
with OS X, right? Apple got the header files installed in the
wrong location. Your best bet is to install your own version
of Ruby in /usr/local.

This is the reason I absolutely hated compiling anything on a mac at my
old job. Apple stuffs libraries in god knows where, and it’s a
nightmare trying to figure it all out. Of course, if you use Xcode to
compile, it knows where they all are (most of the time), but try getting
the admins to let you run Xcode on a server…

Thankfully, my new job is working with *BSD and linux.

-Doug

On May 24, 2007, at 8:29 AM, Ari B. wrote:

file and saving it.
Which version of OSX are you using?
The tcsh shell was default in Panther, but in Tiger default is bash.
Bash is a bit easier, since there is more current stuff on blogs and
websites to help you with that.
Either way, consider getting the book Unix in a Nutshell. It covers
all the major unixes including OSX and the major shells.
You’ll find it handy as a reference when you want to install or
change things in OSX.
the Hivelogic site does have pretty much the best and most up-to-date
how-to’s on installing Ruby/Rails/etc… on OSX.
The preferred environment is to do your own install, since Apple
admittedly munged the factory Ruby install.
Good news is, it is easy to do and the experience will help you
learning about the unix command line environment more.
More good news, the next OSX, Leopard, has it installed correctly.

On 5/23/07, Tim H. [email protected] wrote:

Ari B. wrote:

Sweet Ruby Gods please help me

You’re running the version of Ruby that comes pre-installed with OS X,
right? Apple got the header files installed in the wrong location. Your
best bet is to install your own version of Ruby in /usr/local.

This was IIRC fixed in 10.4.8.

I think that the problem Ari has is that he didn’t select the
BSD/Xcode SDK when installing Mac OS X. By default the Ruby headers
are not installed, you need to implicitly specify this during install
(or post install, browse the DVD and install the right .pkg).

Laurent

On May 23, 2007, at 11:02 PM, Doug P. wrote:

and through /private/etc/csh.cshrc
I am adding setenv PATH /usr/local/bin/:$PATH to the end of
the file and saving it.

I could be wrong, but I believe that csh needs the variable to be
in the
form of ${var}, e.g. ${PATH}

Or at least that’s always how I’ve done it.

Yup. You’re right. After three hours of frustration and profanity, I
managed to screw up my computer and then put it back together.

Damn curly braces gave me hell and high waters.

-------------------------------------------------------|
~ Ari
crap my sig won’t fit