Installing Rails on Leopard

The installation process for Rails has 3 steps:

1. Install the Apple Developer Tools (Xcode) found on the Mac OS X
installation disk or downloaded from the Apple Developer Connection
downloads page.

2. Download and install MacPorts (formerly DarwinPorts). This tool
greatly simplifies the installation of Ruby on Rails and can be later
used to update or remove Rails. MacPorts can be installed from a
familiar disk image file.

3. Open the Terminal application and type the following command,
followed by the return key. It will most likely prompt you to enter
your password.

sudo port install ruby

Steps 1 & 2 are easy enough: Xcode and MacPorts installs without
problem. However, when I enter the command: sudo port install ruby I
get an error:

sudo: port: command not found

It seems the path is not being set.

If anyone know a quick fix for this I would appreciate it. I am not
very familiar with the "under the hood" stuff on the Mac.

Ruby, Rails, SQLite-3 and Subversion are all installed on Leopard by
default.

Is there a reason you're not using these?

I can’t speak for the OP, and I’m a Mac newbie myself, so I’m answering your question as a request for education rather than any assertion of wisdom on my part… here’s the reason I use the macports version:

dbrady@shiny:~$ /usr/bin/rails --version
Rails 1.2.6
dbrady@shiny:~$ /opt/local/bin/rails --version
Rails 2.0.2

I would happily standardize if this is considered better; is there a way to upgrade Leopard’s Rails?

byronbay: If you’re as much of a newbie as I am, it may be something as simple as needing to restart Terminal before the new path will be picked up by bash.

David

Simple reason is that I had no idea it was installed already. Why
would I? The official Rails site makes no mention of it and so I
tried to follow their installation instructions for Mac OS X. Surely
Leopard has been out long enough for the Rails guys to have updated
the site... Their instructions are, in any case, missing some
important steps AND they point to Locomotive which, according to the
author, is no longer being developed because RonR is preinstalled on
Leopard...

... which was a rather circuitous path to find I had just wasted a
morning. I could say lots of unpleasant things at this stage about
the open-source environment... but then that would just be because my
time is important to me and i hate wasting it...

Hi David

I gave up developing in RonR a year ago out of sheer frustration at
the lack of decent manuals, any support (except for the exceptional
ryanb on the Rails forum at http://railsforum.com/). Its not a good
sign that the Rails community hasn't updated their installation
instructions for Leopard as yet...

Anyway, I have to persevere - I am hoping it will not be so
frustrating an experience this time around.

/stephen

I posted this article a few weeks ago that walks you through the
entire process.

* http://rubyurl.com/cKyM

Enjoy!

You have to add the ports bin/sbin paths to your PATH variable. Open/
create a file called .profile in your home directory. The add this:

export PATH=/opt/local/bin:/opt/local/sbin:$PATH

You can then either type this: source ~/.profile or logout and log
back in again...

Matt

It would be great if someone would post this link on the official
Rails site so I can stop repeating myself.

Here is the "official" site for Ruby on Mac OS X Leopard:
http://ruby.macosforge.org/

And there's a nice FAQ here:
http://trac.macosforge.org/projects/ruby/wiki/FAQ

Read and all your questions will answered (well most anyway).

sorry byronbay, but a little "rails leopard" in google would have
saved your morning

I've build rails on my Mac Tiger a few months ago using the following:
http://hivelogic.com/articles/ruby-rails-mongrel-mysql-osx/
I am about to buy a new Mac which I guess will come with Leopard.

If I want my local environment to include MySQL, Subversion and
Mongrel, should I use the post by hivelogic or should I use Mac Ports?
What would you recommend?

- Elle

David Brady wrote:

I would happily standardize if this is considered better; is there a way
to upgrade Leopard's Rails?

sudo gem install rails --include-dependencies

The latest gem version defaults to the --include-dependencies (or -y) parameter iirc, you don’t need to add it anymore. (sudo gem update --system)

Best regards

Peter De Berdt

Peter De Berdt wrote:

-y is just a short version of --include-dependencies, just like it’s fairly common to be able to use -v and --version to get an app version.

Best regards

Peter De Berdt