Replace constant RAILS_ENV by Rails.env

Using RAILS_ENV fails in Rails 3.2. This change makes CBAC incompatible with Rails 2.x