[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby Header Files in Mac OS X

Ari Brown

5/23/2007 8:19:00 PM

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



10 Answers

Henry Maddocks

5/23/2007 8:51:00 PM

0


On 24/05/2007, at 8:19 AM, Ari Brown 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

Ari Brown

5/23/2007 8:58:00 PM

0

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

>
> On 24/05/2007, at 8:19 AM, Ari Brown 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

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.


Tim Hunter

5/23/2007 9:41:00 PM

0

Ari Brown 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.

--
RMagick [http://rmagick.rub...]
RMagick Installation FAQ [http://rmagick.rub.../install-faq.html]


Ari Brown

5/23/2007 10:10:00 PM

0


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

> Ari Brown 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



Tim Hunter

5/23/2007 10:21:00 PM

0

Ari Brown 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 :-)

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.

--
RMagick [http://rmagick.rub...]
RMagick Installation FAQ [http://rmagick.rub.../install-faq.html]


Henry Maddocks

5/23/2007 10:22:00 PM

0


On 24/05/2007, at 10:09 AM, Ari Brown 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.

Henry Maddocks

5/23/2007 10:25:00 PM

0


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

> Ari Brown 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...

http://hivelogic.com/narrative/articles/ruby-rails-mongrel...

Stefan Rusterholz

5/23/2007 10:30:00 PM

0

Henry Maddocks wrote:
> On 24/05/2007, at 10:21 AM, Tim Hunter wrote:
>
>> Ari Brown 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...
>
> http://hivelogic.com/narrative/articles/ruby-rails-mongrel...

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

--> be happy

--
Posted via http://www.ruby-....

John Joyce

5/24/2007 5:42:00 AM

0


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

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

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.

Laurent Sansonetti

5/24/2007 11:09:00 AM

0

On 5/23/07, Tim Hunter <TimHunter@nc.rr.com> wrote:
> Ari Brown 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