Fixed tutorial code problems; updated gems and upgraded rails to 4.0