Dave Howell
7/17/2006 11:42:00 PM
On Jul 14, 2006, at 20:37, Mat Schaffer wrote:
On Jul 14, 2006, at 8:31 PM, Ryan Raaum wrote:
I would not modify anything in /usr/bin directly. Apple assumes that
the system /usr/bin is theirs and unmodified and will (and have!) change
things there in updates without warning - possibly breaking your
modifications and potentially causing serious system problems.
Installing in /usr/local and prepending it to your path is the usual
unix way of doing things.
Just to speak on this point, I've been safely using the replacement
solution for about 6 months now with no trouble at all. But the one
thing I did after I moved /usr/bin/ruby is to make a link from
/opt/local/bin/ruby (my darwinports installation) to /usr/bin/ruby.
Pathing works most of the time, but I had some problems with
RadRails/Eclipse because it doesn't appear to honor pathing provided in
profile or .login.
I have become convinced that not completely obliterating the
Apple-default Ruby is a mistake. The fact that my 1.8.4 politely put
itself next to, instead of on top of, the 1.6.8 Jaguar Ruby has
repeatedly caused malfunctions and path errors.
1) First there was the whole "hey, I installed it but it doesn't work"
thing that requires learning the voodoo of .bash_profile (yea, yea,
many of you can't even remember when you didn't know about it, but
finding the documentation that answered the question "why do I get the
wrong Ruby?" is a bitch, since it requires learning quite a bit of new
vocabulary before you can even search for the answer.)
2) I got to do it all over again when I installed RubyCocoa, since
frameworks don't give a diddly-dang what's in your .bash-profile, and
the 1.8.4 Ruby compile/install hadn't hunted down an earlier
Ruby.framework. Debugging THAT one was extremely difficult, involving
running "lsof" on my compiled program, discovering that XCode had
found, and was using, a different Ruby.framework than the one I knew
about, and trashing it.
3) Two days ago, I once again had a Ruby program fail because it's
running the wrong Ruby, and I eventually had to give up on this one. My
text editing program lets me run text through shell scripts as text
filters; so I wrote a Ruby script to pretty-format HTML. Except I can't
run it, because all the gems are installed into 1.8.4. The scripts
inherit their environment from the text editor, which inherits it from
the Finder, which does not use ~/.bash_login, nor /etc/profile, nor
/etc/bashrc, nor any other file which I can find on my system.
[It's using SOMETHING, because it has
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/Users/dave, which isn't what you
get from "bash --noprofile"]
This time, I just gave up and hard-coded #!/usr/local/bin/ruby
Next time, I'll probably erase the entire 1.6.8 code base from my
system, and replace it with links to my 1.8.4.
[OK, so this time, I hard-coded
#!/Library/Ruby/bin/ruby
but that's a different kettle of fish. There's a hard link in
/usr/local/bin for the non-zero number of Ruby-related programs that
think paths are legally regulated or something. Not many people appear
to have noticed that Apple installs scripting languages in /Library or
/System/Library, not in invisible folders, except for the command-line
binaries for the languages, which are in /usr/bin. ]