Ruby Install/Upgrade OS X Panther 10.3

I have Mac OS X 10.3 or Panther if you will. I am looking for
clarification on upgrading Panther's built in Ruby to the latest
version. I have tried downloading, configuring, making, making
install... but then what. That's where the tutorials go dry. How do I
run the install, or is the install run when you type make install? When
I type ruby -v at the shell I still get 1.6.8!

When you installed, did you install into /usr/local/bin? If so, is it in your path (probably not by default).

Try running /usr/local/bin/ruby -v

If that's now 1.8.2, you can add /usr/local/bin to the front of your path.

On my box, I install 1.8.2 directly into my home directory by specifying a prefix when I build it:

    ./configure --prefix=/Users/dave/ruby_1.8
    make
    make install

I then add /Users/dave/ruby_1.8/bin to the front of my path, and run it from there.

···

On Jan 6, 2005, at 12:56 AM, jotto wrote:

I have Mac OS X 10.3 or Panther if you will. I am looking for
clarification on upgrading Panther's built in Ruby to the latest
version. I have tried downloading, configuring, making, making
install... but then what. That's where the tutorials go dry. How do I
run the install, or is the install run when you type make install? When
I type ruby -v at the shell I still get 1.6.8!

Yes, it definitely is 1.8.2 in /usr/local/bin. What does it mean to add
it to the front of my path, just type that out every time I want to
access the newer version of Ruby? Or do I edit some shell file? Where
is that file? How can I open it?

Quoteing jonathan.otto@gmail.com, on Fri, Jan 07, 2005 at 12:41:30AM +0900:

Yes, it definitely is 1.8.2 in /usr/local/bin. What does it mean to add
it to the front of my path, just type that out every time I want to
access the newer version of Ruby? Or do I edit some shell file? Where
is that file? How can I open it?

Your path is the value of the PATH environment variable. It is a list of
directories to search for executable files. Use "env" to see your
environment.

You need to add something like:

  setenv PATH "/usr/local/bin:$PATH"

to either your ~/.cshrc or ~/.tcshrc file.

I would highly suggest buying a book about how to use the Unix
underpinnings of OS X. It will cover this, and also how to edit files.

The syntax above may not be exact, I use OS X, but not tcsh.

Cheers,
Sam

jotto wrote:

Yes, it definitely is 1.8.2 in /usr/local/bin. What does it mean to add
it to the front of my path, just type that out every time I want to
access the newer version of Ruby? Or do I edit some shell file? Where
is that file? How can I open it?

The file ~/.bash_profile gets executed when you log in and the file ~/.bashrc gets executed when you open a Terminal window. I'd put something like this into ~/.bash_profile:

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

Jim

···

--
Jim Menard, jimm@io.com, http://www.io.com/~jimm

It is twofold. Fix your path ala the other email in this thread. You should also do the following:

  cd /usr/bin
  sudo mv ruby ruby16
  sudo mv irb irb16

If you have any scripts that use /usr/bin/ruby you might also want to make symbolic links to /usr/local/bin/ruby, but honestly it is just better to fix the shebangs to point to /usr/local/bin/ruby (my pref) or use env ruby to find the right one dynamically.

···

On Jan 6, 2005, at 7:41 AM, jotto wrote:

Yes, it definitely is 1.8.2 in /usr/local/bin. What does it mean to add
it to the front of my path, just type that out every time I want to
access the newer version of Ruby? Or do I edit some shell file? Where
is that file? How can I open it?

And bash is now the default OS X shell. See Jim Menard's response if that's your shell.

James Edward Gray II

···

On Jan 6, 2005, at 10:08 AM, Sam Roberts wrote:

The syntax above may not be exact, I use OS X, but not tcsh.

Thank you for all your help. Here is the process for future reference.

Open Terminal, type "vi ~/.profile" without quotes

Type "i" to tell vi to insert at beginning of file

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

Hit esc to switch to command mode, type ":wq" to save and quit

Changing OS X bash
http://www.peachpit.com/articles/article.asp?p=31442&seqNum=4
vi commands
http://www.ss64.com/bashsyntax/vi.html