Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > uninstalling the mac tiger version of ruby

Reply
Thread Tools

uninstalling the mac tiger version of ruby

 
 
libsfan01
Guest
Posts: n/a
 
      01-21-2007
hi all



in trying to uninstall the mac version of ruby how can i do this?

 
Reply With Quote
 
 
 
 
libsfan01
Guest
Posts: n/a
 
      01-21-2007
My reason for wanting to uninstall is that ive tried to install the
latest version but terminal is still telling me that the version is
1.8.2 not 1.8.5 that i downloaded, so it must have gotten messed up
somewhere right?


libsfan01 wrote:
> hi all
>
>
>
> in trying to uninstall the mac version of ruby how can i do this?


 
Reply With Quote
 
 
 
 
Gene Tani
Guest
Posts: n/a
 
      01-21-2007

libsfan01 wrote:
> My reason for wanting to uninstall is that ive tried to install the
> latest version but terminal is still telling me that the version is
> 1.8.2 not 1.8.5 that i downloaded, so it must have gotten messed up
> somewhere right?
>
>


There's been numbers of posts on installing Rails from Locomotive,
darwinport/Macports or source recently:

http://blog.nanorails.com/articles/2...mac-os-x-tiger
http://blog.nanorails.com/articles/2...x-tiger-10-4-8
http://www.sitening.com/blog/2006/05...th-os-x-tiger/

http://www.slashdotdash.net/articles...-a-rails-coder
http://blog.pjkh.com/2007/1/15/build...friends-on-osx
http://mandhro.com/2006/06/16/settin...s-development/

http://blog.labratz.net/articles/200...braries-on-osx

I forget which one i followed. You don't hear too much about fink
these days. And i don't know about the factory-installed ruby, but
there's stern warnings in my OS X books abotu not uninstalling the
factory-installed perl and python.


 
Reply With Quote
 
Phrogz
Guest
Posts: n/a
 
      01-21-2007
libsfan01 wrote:
> My reason for wanting to uninstall is that ive tried to install the
> latest version but terminal is still telling me that the version is
> 1.8.2 not 1.8.5 that i downloaded, so it must have gotten messed up
> somewhere right?


Probably your PATH environment variable is set to use the
tiger-installed version, instead of your new version. Observe:

slim:~ gavinkistner$ /usr/bin/ruby -v
ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0]

slim:~ gavinkistner$ /usr/local/bin/ruby -v
ruby 1.8.5 (2006-08-25) [powerpc-darwin8.7.0]

slim:~ gavinkistner$ env
[...snip...]
PATH=.:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin
[...snip...]

slim:~ gavinkistner$ which ruby
/usr/local/bin/ruby

In other words, Apple's build lives in /usr/bin, my latest stable build
lives in /usr/local/bin. If I just type "ruby", the PATH environment
variable chooses which directories to look in, and the order to look.
IIRC had to change my PATH to put my local bin directory before
/usr/bin, because I always wanted programs that I had built and
installed to supercede existing installs.

If you really want, you can go in as root and rename /usr/bin/ruby (and
irb and rdoc and others) to have a different name, like ruby182. Or you
could delete them, and hope that nothing relied on them. But I'd just
go with the PATH solution.

 
Reply With Quote
 
Timothy Hunter
Guest
Posts: n/a
 
      01-21-2007
libsfan01 wrote:
> My reason for wanting to uninstall is that ive tried to install the
> latest version but terminal is still telling me that the version is
> 1.8.2 not 1.8.5 that i downloaded, so it must have gotten messed up
> somewhere right?
>
>
> libsfan01 wrote:
>
>> hi all
>>
>>
>>
>> in trying to uninstall the mac version of ruby how can i do this?
>>

>
>
>

No, don't uninstall the version of Ruby that comes with OS X. That
version is installed in the /usr/bin directory. When you installed Ruby
yourself, you probably installed it (assuming you built it from source
and took the defaults) in /usr/local/bin. All you have to do is make
sure your $PATH variable has /usr/local/bin preceding /usr/bin. When you
execute the "ruby" command OS X will search the directories in the order
listed by $PATH and will find your ruby in /usr/local/bin.

Check it out like this. Enter this command:

/usr/bin/ruby -v

You'll probably get "ruby 1.8.2". Then enter:

/usr/local/bin/ruby -v

You'll probably get "ruby 1.8.5"

Of course, if you specified another prefix when you ran the configure
script, or if you installed Ruby from MacPorts or fink, then Ruby is
installed in a different directory.

For more information about PATH, do a "man bash" in an OS X terminal window.

 
Reply With Quote
 
libsfan01
Guest
Posts: n/a
 
      01-21-2007

>
> You'll probably get "ruby 1.8.5"
>


Yes it seems to be the case that its looking for the wrong version.
timothy how can i change the setting of the path variable so that the
latest version is accessed? (from "usr/bin/ruby" to
"usr/local/bin/ruby")?

thanks

marc

 
Reply With Quote
 
libsfan01
Guest
Posts: n/a
 
      01-21-2007

>
> You'll probably get "ruby 1.8.5"
>


Yes it seems to be the case that its looking for the wrong version.
timothy how can i change the setting of the path variable so that the
latest version is accessed? (from "usr/bin/ruby" to
"usr/local/bin/ruby")?

thanks

marc

 
Reply With Quote
 
Timothy Hunter
Guest
Posts: n/a
 
      01-21-2007
libsfan01 wrote:
>> You'll probably get "ruby 1.8.5"
>>
>>

>
> Yes it seems to be the case that its looking for the wrong version.
> timothy how can i change the setting of the path variable so that the
> latest version is accessed? (from "usr/bin/ruby" to
> "usr/local/bin/ruby")?
>
> thanks
>
> marc
>
>


PATH is an environment variable that the bash shell uses when it
searches for a command. In bash you set environment variables like this:

export VAR=value

Notice there's no leading $ in the name when it's on the left-hand side
of the assignment. When you want to get the value of an environment
variable you precede its name with a $. Now, you want to prepend
/usr/local/bin to the current value of PATH. Enter this command:

echo $PATH

This will show you the current value of PATH. Then enter:

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

(Directories in the PATH are separated by colons.) issue "echo $PATH"
again to ensure that the change worked.

Now enter "ruby -v". You should see "ruby 1.8.5" because OS X found ruby
in /usr/local/bin.

Of course you don't want to have to redefine your PATH variable every
time you open a terminal. To get your PATH set the way you want it every
time you can add this command to a bash configuration script. The bash
shell gets its configuration from a number of scripts. I believe the
preferred one for this sort of thing is .bash_profile. The bash shell
looks for this file in your home directory. You may already have such a
file. If so, save a backup copy, open it in a text editor and add the
command on a separate line. If the file doesn't already exist, create it
and add these two lines:

#! /bin/bash
export PATH=/usr/local/bin:$PATH

Save the file, close the terminal window and open a new one. Issue "echo
$PATH" again to see your changed PATH. Issue "ruby -v" and ensure that
you're getting "ruby 1.8.5".

Warning: be careful. If you screw up your path many things in OS X will
stop working. If you encounter problems (like commands not working) just
delete your .bash_profile (or restore it to its previous state) and try
again. Always close the terminal window and open a new window after
making a change.

For more info search for bash on the web or issue the "man bash" command
in a terminal window.

 
Reply With Quote
 
Aaron Massey
Guest
Posts: n/a
 
      09-20-2007
I have a similar problem. I installed a manually compiled version of
ruby, rails and gem at /usr/local/bin. They all work fine and I have my
environment variables setup so that I can use them in a Terminal without
problems. However, when I start WEBrick, it is defaulting to the Mac OS
X version of rails. Where can I set the version of ruby that WEBrick
should be using?

Thanks in advance!
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
John Joyce
Guest
Posts: n/a
 
      09-20-2007
I posted something about it on my blog recently, after a recent OS X
update screwed up my $PATH
That's something you need to spend the time looking into.
The one-click installer may or may not replace the old Ruby, but the
Hivelogic install directions will get you what you want.
Don't worry though, only 1 more likely update to OS X 10.4 (10.4.11)
and 10.5 will be out with a working Ruby.
You should install the mongrel gem though. It makes a much more
responsive test server with the built in apache. (and you don't have
to turn apache off to use it, and most hosts providing shell access
and ruby/rails will be on apache anyway.
The book Rails Solutions, from Friends of ED, has an excellent
install/setup for Ruby and Rails in it.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Where to get stand alone Dot Net Framework version 1.1, version2.0, version 3.0, version 3.5, version 2.0 SP1, version 3.0 SP1 ? MowGreen [MVP] ASP .Net 5 02-09-2008 01:55 AM
Re: Where to get stand alone Dot Net Framework version 1.1, version 2.0, version 3.0, version 3.5, version 2.0 SP1, version 3.0 SP1 ? PA Bear [MS MVP] ASP .Net 0 02-05-2008 03:28 AM
Re: Where to get stand alone Dot Net Framework version 1.1, version 2.0, version 3.0, version 3.5, version 2.0 SP1, version 3.0 SP1 ? V Green ASP .Net 0 02-05-2008 02:45 AM
Complete Fix for Ruby on Mac OS X 10.4 Tiger Lucas Carlson Ruby 0 05-02-2005 01:52 AM
Ruby 1.8.x in Mac OS X.4 (Tiger)? Randy Lawrence Ruby 2 07-12-2004 01:11 AM



Advertisments