update rails and other gems

There's a whole list of vulnerabilities in rails 4.0.0. Updated rails and some other gems to secure it up.

I did not run any tests with this.