Can't upgrade ruby on Snow Leopard

I've followed the instructions here:
http://hivelogic.com/articles/compiling-ruby-rubygems-and-rails-on-snow-leopard

...and everything seems to go ok. I do ruby -v and I'm told I have
1.9.2, but after restarting the machine it goes back to 1.8.7 :-/

Am I doing something wrong?

Should I just use macports or fink or locomotive? I will be using it
mainly for Rails.

Thanks in advance.

···

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

Have you considered looking at rvm?

http://rvm.beginrescueend.com/

It seems it's a problem with your paths variable. You should see that ruby and friends did indeed get installed in the /usr/local/bin directory, which could only happen installing as root (using sudo).

Is /usr/local/bin still at the beginning of your paths when you do echo $PATH? Is your default user shell bash? My hunch is your .profile file is being ignored. Until it's resolved, as a work-around, you can refer to the ruby command using it's full path (/usr/local/bin/ruby) or create an alias to it...

alias ruby='/usr/local/bin/ruby'

Jose

···

On Sep 29, 2010, at 4:05 PM, Ast Jay <azzzz@gmx.net> wrote:

...and everything seems to go ok. I do ruby -v and I'm told I have
1.9.2, but after restarting the machine it goes back to 1.8.7 :-/

Am I doing something wrong?

-------------------------
Jose Hales-Garcia

Ast Jay wrote:

I've followed the instructions here:
Dan Benjamin

...and everything seems to go ok. I do ruby -v and I'm told I have
1.9.2, but after restarting the machine it goes back to 1.8.7 :-/

Am I doing something wrong?

Should I just use macports or fink or locomotive? I will be using it
mainly for Rails.

Thanks in advance.

1. fink is obsolete, please use macports over fink.

Macports installs in opt/local/bin which does not get overwritten when
you upgrade OSX. The gripe I have with the hivelogic way is that it
installs in /usr and that used to get overrwritten by OSX.

rvm is the preferred way as you can easily switch between various
versions of ruby. Perhaps you should post the errors you face with rvm
so the author can help you.

At any rate, do not delete the system ruby (/usr/bin/ruby) as you may
need it to compile things like vim with ruby support.

···

--
Posted via http://www.ruby-forum.com/\.

Adam Prescott wrote:

Have you considered looking at rvm?

http://rvm.beginrescueend.com/

I originally have RVM installed, but it kept throwing errors every now
and again - so thought I'd ditch it :-/

···

--
Posted via http://www.ruby-forum.com/\.

Jose Hales-Garcia wrote:

...and everything seems to go ok. I do ruby -v and I'm told I have
1.9.2, but after restarting the machine it goes back to 1.8.7 :-/

Am I doing something wrong?

It seems it's a problem with your paths variable. You should see that
ruby and friends did indeed get installed in the /usr/local/bin
directory, which could only happen installing as root (using sudo).

Is /usr/local/bin still at the beginning of your paths when you do echo
$PATH? Is your default user shell bash? My hunch is your .profile file
is being ignored. Until it's resolved, as a work-around, you can refer
to the ruby command using it's full path (/usr/local/bin/ruby) or create
an alias to it...

alias ruby='/usr/local/bin/ruby'

Jose

Hi Jose

echo $PATH gives me:

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin:/usr/local/mysql/bin

How do I find out if my default user is shell bash? (there's only one
account on this Mac - if that's what you mean)

If I use the alias - will it mess anything up further down the line?
(And will it be ok for Rails etc?) .profile is still in my home folder
:-/

···

On Sep 29, 2010, at 4:05 PM, Ast Jay <azzzz@gmx.net> wrote:

--
Posted via http://www.ruby-forum.com/\.

Rahul Kumar wrote:

Ast Jay wrote:

I've followed the instructions here:
Dan Benjamin

...and everything seems to go ok. I do ruby -v and I'm told I have
1.9.2, but after restarting the machine it goes back to 1.8.7 :-/

Am I doing something wrong?

Should I just use macports or fink or locomotive? I will be using it
mainly for Rails.

Thanks in advance.

1. fink is obsolete, please use macports over fink.

Macports installs in opt/local/bin which does not get overwritten when
you upgrade OSX. The gripe I have with the hivelogic way is that it
installs in /usr and that used to get overrwritten by OSX.

rvm is the preferred way as you can easily switch between various
versions of ruby. Perhaps you should post the errors you face with rvm
so the author can help you.

At any rate, do not delete the system ruby (/usr/bin/ruby) as you may
need it to compile things like vim with ruby support.

Thanks for the heads up about Fink - it is still listed on the rails
site, hence I considered it.

I just want a set-up that works tbh, hence being put off RVM - I am
learning rails so just want to be able to get into that and not worry
about additional errors/set-backs. Thanks to Jose I now have 1.9.2
working and if I need to upgrade again will use RVM next time, as by
then I should be a bit more knowledgeable about it all. Thanks for you
help :slight_smile:

···

--
Posted via http://www.ruby-forum.com/\.

Apple will NOT overwrite /usr/local. In my ten years administering OS X, Apple never has, they never will. It's part of their NeXTSTEP culture.

By the way, the migration application, for copying data from old machines to new ones, now copies over /usr/local.

Jose
.......................................................
Jose Hales-Garcia
UCLA Department of Statistics
jose.halesgarcia@stat.ucla.edu

···

On Sep 29, 2010, at 10:16 PM, Rahul Kumar wrote:

Macports installs in opt/local/bin which does not get overwritten when
you upgrade OSX. The gripe I have with the hivelogic way is that it
installs in /usr and that used to get overrwritten by OSX.

How do I find out if my default user is shell bash?

Do..

echo $SHELL

(there's only one
account on this Mac - if that's what you mean)

There's also a system root account (among others) which you invoke when you do 'sudo some-command'.

Does your .profile contain the entry...?

export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"

Jose
.......................................................
Jose Hales-Garcia
UCLA Department of Statistics
jose.halesgarcia@stat.ucla.edu

···

On Sep 29, 2010, at 5:40 PM, Ast Jay wrote:

Jose Hales-Garcia wrote:

Macports installs in opt/local/bin which does not get overwritten when
you upgrade OSX. The gripe I have with the hivelogic way is that it
installs in /usr and that used to get overrwritten by OSX.

Apple will NOT overwrite /usr/local. In my ten years administering OS
X, Apple never has, they never will. It's part of their NeXTSTEP
culture.

Strangely, whenever I did an OS upgrade using Software Update, (and I
mean the
minor upgrades), my /usr/local was always put into 'Deleted Folders' or
something.

I would have NO /usr/local left. Deleted. In fact, I had to create a
/usr/local for Hivelogics installs. iirc, others have also had this
problem. Thankfully, OSX does not touch or know about /opt.

To the OP, rvm installed with no problems. (I've only failed to install
macruby through RVM, but there's an installable download which works
fine.)

···

On Sep 29, 2010, at 10:16 PM, Rahul Kumar wrote:

--
Posted via http://www.ruby-forum.com/\.

Jose Hales-Garcia wrote:

···

On Sep 29, 2010, at 5:40 PM, Ast Jay wrote:

How do I find out if my default user is shell bash?

Do..

echo $SHELL

(there's only one
account on this Mac - if that's what you mean)

There's also a system root account (among others) which you invoke when
you do 'sudo some-command'.

Does your .profile contain the entry...?

export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"

Jose
.......................................................
Jose Hales-Garcia
UCLA Department of Statistics
jose.halesgarcia@stat.ucla.edu

echo $SHELL gives me:

/bin/bash

mate .profile gives me:

export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"

I'm on OSX 10.6.4

:-/
--
Posted via http://www.ruby-forum.com/\.

I did a test and found that .bash_profile overrides .profile. You should check that you don't have a .bash_profile file with a $PATH definition of its own.

I don't fully understand the subtle interactions of Bash resource files (I use TCSH myself), but you might try renaming .profile to .bash_profile.

Jose
.......................................................
Jose Hales-Garcia
UCLA Department of Statistics
jose.halesgarcia@stat.ucla.edu

···

On Sep 29, 2010, at 6:24 PM, Ast Jay wrote:

echo $SHELL gives me:

/bin/bash

mate .profile gives me:

export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"

I'm on OSX 10.6.4

Jose Hales-Garcia wrote:

echo $SHELL gives me:

/bin/bash

mate .profile gives me:

export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"

I'm on OSX 10.6.4

I did a test and found that .bash_profile overrides .profile. You
should check that you don't have a .bash_profile file with a $PATH
definition of its own.

I don't fully understand the subtle interactions of Bash resource files
(I use TCSH myself), but you might try renaming .profile to
.bash_profile.

Jose
.......................................................
Jose Hales-Garcia
UCLA Department of Statistics
jose.halesgarcia@stat.ucla.edu

This is the content of my .bash_profile:

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

if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then source
"$HOME/.rvm/scripts/rvm" ; fi

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

I have replaced it's contents with that of my .profile - and it works!
Think it will be safe tho? (I uninstalled RVM so guess so?) Thanks for
your help btw Jose!

···

On Sep 29, 2010, at 6:24 PM, Ast Jay wrote:

--
Posted via http://www.ruby-forum.com/\.