How I installed MySQL, RVM, Ruby, and Rails on Lion

Install MySQL on Lion (Mac OS X 10.7)

Download the 64-bit .dmg of MySQL and install everything it comes with.

Add the following lines to your ~/.profile file

  export CC=/usr/bin/gcc-4.2
  export DYLD_LIBRARY_PATH="/usr/local/mysql/lib:$DYLD_LIBRARY_PATH"

Go to the MySQL panel in System Preferences and start your MySQL Server

Then run these commands in terminal:

  cd /usr/local/mysql
  sudo ./scripts/mysql_install_db
  sudo ./bin/mysql_secure_installation

Install RVM, Ruby, and Rails on Lion

Open up terminal and run this command:

bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)

Add the following line to the end of your ~/.profile file

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function

Restart terminal, then run the commands:

  rvm install 1.9.2
  rvm use 1.9.2
  rvm gemset create rails3
  rvm use 1.9.2@rails3 --default

You can now gem install rails, gem install rails -v=3.0.4, bundle install, etc.