Howto install RoR 2.0 on Mac OS X 10.5 Leopard

Is there a (complete, accurate and working) guide
on how to install Ruby On Rails on Apple Mac OS X Leopard ?

- locomotive does not work
- all the guides I found out there do not work !

If not could you please detail how you installed it
on your MacIntel Leopard machine ?

Thank you so much !

(I thought it would be easy, but right now I am stuck even considering
downgrading to Tiger..)

Here's the official FAQ on RoR in Leopard:
http://trac.macosforge.org/projects/ruby/wiki/FAQ

Here's the quick and dirty:

Step 1:
sudo gem update --system

Step 2:
sudo gem install rails

Step 3:
There is no step 3

Rails comes preinstalled on Leopard, but the preinstalled version is
1.2.3. However, RubyGems is also preinstalled, and you can use gem to
upgrade to rails 2.
gem update --system (updates RubyGems itself)
gem update (updates all your gems, including rails)

rails 2 depends on a new gem, activeresource, that rails 1.2 didn't, so:
gem install activeresource

You can find your gems in /usr/lib/ruby/user-gems/ (which is actually
a symlink to /Library/Ruby/Gems)

As far as rails is concerned updating the preinstalled gems is more or
less what I did on my mac mini, which I did a clean Leopard install
on. On my macbook, I upgraded from Tiger, where I had the rails stack
set up according to the guide at hivelogic.
http://hivelogic.com/articles/ruby-rails-mongrel-mysql-osx/

After the upgrade to Leopard, mysql wasn't working, so I built it from
source, following this guide:
http://hivelogic.com/articles/installing-mysql-on-mac-os-x/

I haven't checked if mysql released a leopard installer since.

Hope that helps
- Martin

Oh and BTW those steps are to upgrade the existing Ruby on Rails that
already exist on Mac OS X Leopard. Leopard comes pre-installed with
Ruby on Rails. It was originally Rails 1.2.3 and one of the Apple
software updates brought it up to 1.2.6. But Rails 2.0.2 is a gem
install away. You don't need to install your own Ruby or RubyGems.
That stuff is all there and can be easily updated to the latest
versions as shown in my previous post.

Absolute beginner here ... absolute ... never even used the terminal
window until today.

when I tried to update the pre-installed Ruby 1.8 it got to
"Attempting remote update of acts_as_ferret and I got this error:

ERROR: While executing gem ... (Gem::FilePermissionError)
     You don't have write permissions into the /usr/bin directory.

So I went Go > Go to Folder /usr/bin, clicked Get Info, unlocked it,
added me and administrators to the list of people who can read and
write, went back to terminal, punched in 'gem update' and got the same
error.

Any tips? Thanks.

Don't go altering permissions on folders like that.

First, run Disk Utility and repair permissions.

Ok, now that you've done that, fire up terminal.

Type:

sudo gem install acts_as_ferret

Enter your password and you're golden.

The permissions are your protection against making really, REALLY bad
mistakes. Use them wisely.

"Wise" and "learning new stuff" is pretty mutually exclusive for me! I
tend to blow things up a few times to understand them :stuck_out_tongue:

Thanks for the help, I did as you said and now I'm getting the same
thing except instead of ferret it's capistrano.

Do I just keep typing in

sudo gem install 'name'

when I get this error?

Yes. sudo gives you super user access for the duration of one command. The hope is that command won't be something really destructive. Here's a bit more elaboration: You typically run as a very privileged user on a Mac, but not a superuser (root). Even your privileged user account does not have default permissions to modify some of the important system directories.

So, for installation of MacPorts or Ruby Gems, you will have to use sudo. I very much recommend you never log in as root. It's a BAD idea (unless you really know what you are doing and why sudo isn't good enough).

Next visit to the terminal window, type:

man sudo

and you will see a little about what sudo allows you to do. Press 'q' to quit the man page.