Here's a good article for installing on Mac OSX: http://hivelogic.com/articles/compiling-ruby-rubygems-and-rails-on-snow-leopard/ It's written for Snow Leopard, but the process should be the same for Lion.
OSX comes with Ruby installed at /usr/bin/ruby . You'll need to install gem and rails.
You can confirm where things were installed by running Terminal.app and typing
which ruby
which gem
which rails
These will most likely be installed in /usr/bin . This directory has to be included in your PATH variable, which the HiveLogic article describes how to do. The article says to include /usr/local/bin and /usr/local/sbin . Include the directory(s) that ruby, rails, and gem are installed in.
You can find out what versions are installed by typing
ruby -v
gem -v
rails -v