How to completely reinstall my rails environment on Mac Lion?

$gem uninstall rails -a

… will un-install all versions of rails.

$gem install rails

… puts it back again.

You can check your rails version before and after by doing:

$rails -v

I would also recommend using rvm - ruby version manager. It allows you to easily install and switch between versions of ruby and maintain multiple sets of gems...to include rails.

gem list | cut -d" " -f1 | xargs sudo gem uninstall -aIx

THIS COMMAND WILL UNINSTALL ALL THE GEMS IN UR SYSTEM .AFTER THAT INSTALL AGAIN WHAT YOU NEED.