[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

can't get my Mac OSX UNIX to run 1.8

superN00b

3/6/2006 2:44:00 AM

Hey guys! This is my first post here, and I've never studied computers
formally, so this is probably going to sound like a stupid question. I
installed Ruby 1.8 using Terminal on Mac OSX (Thank God for Visual
Quickstart Guides). But when I check the version with "ruby -v", it
still says that it's running version 1.6.2 or whatever. So I went
looking for it and sure enough, the new version didn't overwrite the old
one - it just set tself up next to it. So the shell just keeps on using
the old one.

I don't know what to do - do i just erase the old one and hope that the
shell starts using the new one instead? Or is there some kind of setting
i have to mess with?

Thanks in advance.

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


8 Answers

Tim Hunter

3/6/2006 2:59:00 AM

0

superN00b wrote:
> Hey guys! This is my first post here, and I've never studied computers
> formally, so this is probably going to sound like a stupid question. I
> installed Ruby 1.8 using Terminal on Mac OSX (Thank God for Visual
> Quickstart Guides). But when I check the version with "ruby -v", it
> still says that it's running version 1.6.2 or whatever. So I went
> looking for it and sure enough, the new version didn't overwrite the old
> one - it just set tself up next to it. So the shell just keeps on using
> the old one.
>
> I don't know what to do - do i just erase the old one and hope that the
> shell starts using the new one instead? Or is there some kind of setting
> i have to mess with?
>
> Thanks in advance.
>

The version of Ruby that comes with OS X is installed in /usr/bin. The
version you installed is (probably) in /usr/local/bin. You can confirm
this by typing

which ruby

Anyway, all you need to do you change your $PATH environment variable to
make /usr/local/bin precede /usr/bin. If you don't know how to do this,
read the "bash" man page about the PATH environment variable. (See the
INVOKATION section.)

Daniel Harple

3/6/2006 3:01:00 AM

0

On Mar 6, 2006, at 3:44 AM, superN00b wrote:
> I installed Ruby 1.8 using Terminal on Mac OSX (Thank God for Visual
> Quickstart Guides). But when I check the version with "ruby -v", it
> still says that it's running version 1.6.2 or whatever. So I went
> looking for it and sure enough, the new version didn't overwrite
> the old
> one - it just set tself up next to it. So the shell just keeps on
> using
> the old one.

I think by default ruby will be installed in /usr/local. The Apple
supplied Ruby is in /usr, and you should not remove it, or overwrite
it. Try setting your PATH variable to include /usr/local/bin first:

Bash:
export PATH=/usr/local/bin:$PATH

But for the long-term, you really should consider using DarwinPorts.
It takes the pain out of installing software from source.

-- Daniel


Logan Capaldo

3/6/2006 3:03:00 AM

0


On Mar 5, 2006, at 9:44 PM, superN00b wrote:

> Hey guys! This is my first post here, and I've never studied computers
> formally, so this is probably going to sound like a stupid
> question. I
> installed Ruby 1.8 using Terminal on Mac OSX (Thank God for Visual
> Quickstart Guides). But when I check the version with "ruby -v", it
> still says that it's running version 1.6.2 or whatever. So I went
> looking for it and sure enough, the new version didn't overwrite
> the old
> one - it just set tself up next to it. So the shell just keeps on
> using
> the old one.
>
> I don't know what to do - do i just erase the old one and hope that
> the
> shell starts using the new one instead? Or is there some kind of
> setting
> i have to mess with?
>
> Thanks in advance.
>
> --
> Posted via http://www.ruby-....
>

Assuming that ruby is installed in /usr/local have your .login file
or .bashrc have the following line:

PATH=/usr/local/bin:$PATH



superN00b

3/6/2006 3:38:00 AM

0


> Anyway, all you need to do you change your $PATH environment variable to
> make /usr/local/bin precede /usr/bin. If you don't know how to do this,
> read the "bash" man page about the PATH environment variable. (See the
> INVOKATION section.)

OK. I looked it up, but all i found was this description:

PATH The search path for commands. It is a colon-separated list of
directories in which the shell looks for commands (see
COMMAND
EXECUTION below). The default path is system-dependent,
and is
set by the administrator who installs bash. A common
value is
``/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin:.''.

So I know what it is, but where does it live? Do I change it with vi? Is
it a text file or part of a text file? Sorry, I really have zero idea
what I'm doing.

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


superN00b

3/6/2006 3:40:00 AM

0

Logan Capaldo wrote:
> On Mar 5, 2006, at 9:44 PM, superN00b wrote:
>
>> the old one.
>> Posted via http://www.ruby-....
>>
>
> Assuming that ruby is installed in /usr/local have your .login file
> or .bashrc have the following line:
>
> PATH=/usr/local/bin:$PATH

Sorry! Where can I find these files? I can change them with vi, right?

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


superN00b

3/6/2006 3:48:00 AM

0

Daniel Harple wrote:
> On Mar 6, 2006, at 3:44 AM, superN00b wrote:
>> I installed Ruby 1.8 using Terminal on Mac OSX (Thank God for Visual
>> Quickstart Guides). But when I check the version with "ruby -v", it
>> still says that it's running version 1.6.2 or whatever. So I went
>> looking for it and sure enough, the new version didn't overwrite
>> the old
>> one - it just set tself up next to it. So the shell just keeps on
>> using
>> the old one.
>
> I think by default ruby will be installed in /usr/local. The Apple
> supplied Ruby is in /usr, and you should not remove it, or overwrite
> it. Try setting your PATH variable to include /usr/local/bin first:
>
> Bash:
> export PATH=/usr/local/bin:$PATH
>
> But for the long-term, you really should consider using DarwinPorts.
> It takes the pain out of installing software from source.
>
> -- Daniel

OK. That seemed to work. I thought "Bash" was a command, so it wasn't
working at first, but then I just took it off and typed in from "export"
and it worked. Thanks!

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


Logan Capaldo

3/6/2006 3:54:00 AM

0


On Mar 5, 2006, at 10:43 PM, Ken Collins wrote:

> But honestly, I thought /usr/local/bin was part of the default
> path, and ahh, I see below it is.

I don't believe it is actually, I don't have a default .bash_profile
(or .profile, etc. I like zsh) and if I cat /etc/profile and /etc/
bashrc:

% cat /etc/profile
# System-wide .profile for sh(1)

PATH="/bin:/sbin:/usr/bin:/usr/sbin"
export PATH

if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
## TeX modifications start at Tue Feb 14 15:11:35 EST 2006
## Do not remove the previous line
if [ `whoami` != "root" ]
then
PATH="$PATH:/usr/local/teTeX/bin/powerpc-apple-darwin-current"
export PATH
fi
## Do not remove the next line
## TeX modifications end at Tue Feb 14 15:11:35 EST 2006


% cat /etc/bashrc
# System-wide .bashrc file for interactive bash(1) shells.
if [ -n "$PS1" ]; then PS1='\h:\w \u\$ '; fi
# Make bash check it's window size after a process completes
shopt -s checkwinsize


I also note that i-Installer has decided to invade the system wide /
etc/profile. That's a bad i-Installer! No cookie!

Gene Tani

3/6/2006 6:32:00 AM

0


superN00b wrote:
> Logan Capaldo wrote:
> > On Mar 5, 2006, at 9:44 PM, superN00b wrote:
> >
> >> the old one.
> >> Posted via http://www.ruby-....
> >>
> >
> > Assuming that ruby is installed in /usr/local have your .login file
> > or .bashrc have the following line:
> >
> > PATH=/usr/local/bin:$PATH
>
> Sorry! Where can I find these files? I can change them with vi, right?
>
> --

You should feel free to ask as many questions as you like to this list,
but you'll also need some unix-y background info, so I recommend the 2
Missing manuals, the "Learnign unix for Tiger" and maybe "Tiger for
Unix geeks" if you really get into it. All excellent books.

http://www.oreilly.com/pub...

Also might want to look at darwin and fink for installing other
packages (as an alternative to tarballs, i.e. .tgz or .tar.gz files:

http://pdb.finkproject.org/pdb/section.php...
http://darwinports.opend...