Upgrade rails to 4.0.2.

This fixes numerous security issues.

See http://weblog.rubyonrails.org/2013/12/3/Rails_3_2_16_and_4_0_2_have_been_released/ for more info.