Fix not load environment files when test

Closes #5289

remove the stub since Rails.root is a waaaaay better way of testing this.
Refactor files

Update 1.8 hash style to 1.9 hash style.

Closes #5288
Update rails version to 4.1.5