Fix NameError during `require 'slim'`

Checking if `Rails` is defined is not a good test of whether Rails is loaded, since many gems use the Rails namespace.

e.g. this will throw an NameError:

```ruby
require "active_resource/railtie"
require "slim"
```