Use Rails.env instead of RAILS_ENV
Merge branch 'master' into rails4