Well, last Friday was my day for Panther. Since I pre-ordered it, my disks arrived early in the afternoon. It was one of the most painless upgrades I have ever performed, while having some really great new features. Of course, shortly after my install, I needed to install the latest version of Ruby. I tried (with a lot of help from James Duncan Davidson) to get Ruby 1.8 in Panther, but it was too late. In order to proceed with with the steps below you need to install the xCode developer's tools that come with Panther.
So, here it goes:
1) Make yourself a directory to build your stuff in (like build) and enter that directory.
2) A great tool that comes with Ruby is irb (Interactive Ruby). One really nice thing in irb is using the up arrow to recall previous lines of typed in Ruby code. The problem is this depends on readline which is not included in Panther. So, we need to install readline prior to installing Ruby. You can do it after, but its more of a PITA.
$ curl -o readline-4.3.tar.gz \ ftp://ftp.gnu.org/gnu/readline/readline-4.3.tar.gz $ tar -xzf readline-4.3.tar.gz $ cd readline-4.3 $ perl -i.bak -p -e \ "s/SHLIB_LIBS=.*/SHLIB_LIBS='-lSystem -lncurses -lcc_dynamic'/g" \ support/shobj-conf $ ./configure $ make $ sudo make install password: (your password) $ cd ..
Note: That perl hack was found to fix a linking problem.
3) UPDATED: Now onto my favorite programming language. Ruby 1.8.1 is the current stable release, and it should be the version built. From the command line do the following:
$ curl -o ruby-1.8.1.tar.gz \ "http://rubyforge.org/download.php/262/ruby-1.8.1.tar.gz" $ tar -xzf ruby-1.8.1.tar.gz
4) Build and install Ruby.
$ cd ruby-1.8.1 $ autoconf $ ./configure
Its worth discussing here that when you run ./configure you can specify the prefix for installation with --prefix. It defaults to /usr/local (which is not included in the default path for Panther's terminal). I leave it in /usr/local even though the Ruby that ships with Panther is in /usr so that I can keep the old version around (for Apple updates, etc). Anyway...
$ make $ make test $ sudo make install password: (your password)
5) Update your path to include /usr/local/bin. I am still running tcsh instead of bash (since the Panther upgrade honored my existing shell...thanks Apple!). Anyway, once you do that test out Ruby and verify its installation:
$ ruby -v ruby 1.8.1 (2003-10-24) [powerpc-darwin]
Cool!
BTW: I am going to try and build a .dmg file of this Ruby build for simple installation by folks that don't want to go through these kind of low-level steps.
Small nit: with sudo, it is necessary to type one's own password, not the root one. "root" is not enabled anyway by default.
Posted by: Ollivier Robert | Monday, October 27, 2003 at 05:37 AM
Right...sorry...it needs to be your password and your account needs to have administrative privilege.
Posted by: Richard Kilmer | Monday, October 27, 2003 at 09:07 AM
This is great. Does your installation give you access to modules in the ext folder? With my installation of 1.8 on 10.2, I was unable to access sockets or tcltk. But that is all in limbo now, as my attempted installation of Panther failed and overwrote 10.2. I hope to try this after I have a system that will boot.
Posted by: GARY PALMER | Monday, October 27, 2003 at 08:23 PM
Got everything to work fine except step 5 'Update your path to include /usr/local/bin'.
For us Unix challenged people how do we do this in Panther?
Posted by: Ross Shaw | Wednesday, October 29, 2003 at 12:29 AM
if you are running Bash and don't mind editing the path for all users, just edit the appropriate line in /etc/profile.
otherwise, you'll need to create a .bashrc or .cshrc file in your home directory - a quick google using these terms should give you a much better grounding in what you can do with these files than i can offer :)
Posted by: James | Monday, November 03, 2003 at 08:31 AM
I want to install ruby 1.8.1 on OS 10.2.8.
Currently I have ruby 1.6.7 that came with
my MAC and OS 10.2.
I am also trying to install some ruby extensions like
extmath which are giving me some trouble.
I am new to ruby and never learned much UNIX,
just enough to barely get along wnenever I needed
it, which wasn't much. (I know about things like
.cshrc, but never had to modify more than a line
occasionally.)
Also, I have not used the developers tools on my MAC.
My installations have been ones from packages that
require following simple directions and clicking with
your mouse ;-)
Ruby is a great language though.
Van
Posted by: Van Jacques | Monday, December 15, 2003 at 01:31 AM
I forgot an important point: Rich says
> In order to proceed with with the steps below you
>need to install the xCode developer's tools that come
>with Panther.
I think I recall reading that these tools don't run
on OS 10.2. Is that correct?
Is there anyone who has installed ruby 1.8 on OS 10.2
who can tell me how it went?
BTW, I also installed Runit on ruby 1.6.7.
Van
Posted by: Van Jacques | Monday, December 15, 2003 at 01:36 AM
I tried to upgrade to 1.8.1 with Panther/XCode but compilation with gcc failed at the final link stage reporting 4 missing symbols, all of which seemed to be gcc-specific inlines... Anyone else seeing this?
Compiling with IBM xlc compiler is fine.
Posted by: Ollivier Robert | Monday, December 29, 2003 at 08:53 AM
To build on 10.2 which doesn't have XCode, you need to install the developpers' CD that is shipped with Jaguar. Then you get gcc and all needed tools.
Posted by: Ollivier Robert | Monday, December 29, 2003 at 08:53 AM
I went through the process on Panther. Figured out how to hack up a usable .bash_profile and .bashrc with vi. Guess what?
NO ruby 1.8.1 ! :(
I ended up with:
ruby 1.9.0 (2004-01-23) [powerpc-darwin]
:O
Not being Unixy programmer and wise to the ways of CSV, I think someone else could be nice a figure how to modify said instructions for the stable branch.
Posted by: Chris Nelson | Sunday, January 25, 2004 at 07:55 AM
Sorry about that Chris, step 3 now tells you how to build Ruby 1.8.1 from the RubyForge mirrored .tar.gz file.
Posted by: Rich Kilm | Sunday, January 25, 2004 at 10:45 PM
Thanks for this. Except that if I install 1.8.1 in the default /usr/local location, a "which ruby" gives me still "/usr/bin/ruby," despite the fact that /usr/local/bin is in my path. I also can't get ri to work with the installation. Any suggestions?
Am new to Ruby, and not anything close to a unix expert.
Posted by: Bruce | Sunday, February 29, 2004 at 06:24 PM
I encounter the same problem as Bruce--Ruby has compiled fine, and I've changed my path to include the new location, but my system still thinks Ruby is in the old location...
Rich, do you have an idea what might be the problem?
(Thanks for a great tutorial, by the way.)
Posted by: JP | Saturday, March 06, 2004 at 02:09 PM
Bruce, I just figured it out: I had to restart Terminal to see the changes.
Now, on to mod_ruby and eruby...!
Posted by: JP | Saturday, March 06, 2004 at 02:10 PM
If you install Ruby into /usr/local (the default location) and want to use this version rather than the one shipped with OS X do the following in your .profile file :
### snip
PATH=/usr/local/bin:$PATH
export PATH
### snip
It is important that /usr/local/bin shows up before /usr/bin in your $PATH environmental variable - since when the shell searches for a command (ie. `ruby`) it recursively searches the directories in $PATH starting with the first one.... so if /usr/bin comes before /usr/local/bin you'll get the old version of Ruby whenever you type `ruby`.
Posted by: C Mills | Wednesday, March 31, 2004 at 05:12 PM
You need to add notes on getting Tk to work with this install of Ruby.
Posted by: Chris Nelson | Saturday, August 07, 2004 at 06:22 PM
I used this resource to get Tk to work
http://www.rubygarden.org/ruby?RubyTkOnOSX
Posted by: Chris Nelson | Saturday, August 07, 2004 at 07:38 PM
If you want to get ri to work beware that rdoc may generate the output in /usr/local/share/ri/1.9/system, instead of /usr/local/share/ri/1.8/system where ri looks for it. It's easy to create a link to handle this.
While in the /usr/local/share/ri/ directory enter this:
$ sudo mkdir 1.8
$ (enter password)
$ cd 1.8
$ ln -s /usr/local/share/ri/1.9/system system
Posted by: Chris Nelson | Thursday, August 12, 2004 at 08:34 PM
There is a readline 5.0 that just came out. Can I use that?
Posted by: Bob | Wednesday, November 03, 2004 at 12:11 AM
Just as the saying goes that you are never too old to learn. I believe it. At first keeping reading all the way can enrich our leisure and knowledge. We can learn a lot from reading. Do you think so?
Posted by: Jordan Retro 8 | Sunday, June 27, 2010 at 08:43 PM
I encounter the same problem as Bruce--Ruby has compiled fine, and I've changed my path to include the new location, but my system still thinks Ruby is in the old location...
Posted by: Air Jordan 23 | Sunday, October 10, 2010 at 08:08 AM
Are you felt that it is right? I do not really think that, but can keep personal opinions!
Posted by: coach outlet | Friday, October 29, 2010 at 11:32 PM
Thank you for sharing your stuff on blog.It is doubtless that we have similar interests.Something are very helpful to me.
Posted by: air jordans | Saturday, October 30, 2010 at 05:03 AM
Thanks for the sharing of those photos and painting works! I wonder whether you are thinking about posting a manual of HDRI? That will be helpful.
Posted by: jordan 2 | Monday, November 01, 2010 at 04:45 AM
Yes. Look! Improves your ability to create nice looking objects and graphics.We have a nice picture.What a nice little book!In fact, they are very nice souvenirs.It would be nice to have less homework.
Posted by: UGG Bailey Button | Tuesday, November 02, 2010 at 02:54 AM
When you love someone, she is perfect in your heart, not because she has no flaws, it is because you love all her flaws, only she has such perfect flaws.
Posted by: Air Jordan Shoes | Wednesday, November 03, 2010 at 03:30 AM
mai yifu zai taobao wang shang mian mai hen fangbian, hen shihui keyi tiaodao ziji xihuan de kuanshi.
Posted by: Louis Vuitton Bags | Tuesday, November 23, 2010 at 09:01 PM
He is unfortunate who cannot bear misfortune
Posted by: Cheap Jordans | Sunday, January 23, 2011 at 09:07 PM