Can't upgrade ruby on Snow Leopard

J

Jose Hales-Garcia

...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 :-/
=20
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...=20

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

Jose
 
A

Ast Jay

Jose said:
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
:-/
 
J

Jose Hales-Garcia

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

Do..

echo $SHELL
(there's only one=20
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=3D"/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"

Jose
.......................................................
Jose Hales-Garcia
UCLA Department of Statistics
(e-mail address removed)
 
A

Ast Jay

Jose said:
Do..

echo $SHELL


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
(e-mail address removed)


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

:-/
 
J

Jose Hales-Garcia

echo $SHELL gives me:
=20
/bin/bash
=20
mate .profile gives me:
=20
export = PATH=3D"/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"
=20
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
(e-mail address removed)
 
R

Rahul Kumar

Ast said:
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.

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

Ast Jay

Jose said:
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
(e-mail address removed)

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!
 
A

Ast Jay

Rahul said:
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 :)
 
J

Jose Hales-Garcia

Macports installs in opt/local/bin which does not get overwritten when=20=
you upgrade OSX. The gripe I have with the hivelogic way is that it=20
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.

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
(e-mail address removed)
 
R

Rahul Kumar

Jose said:
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.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,109
Latest member
JanieMalco
Top