sunspot/sunspot — pull request #551 by boxofrad (2014-02-17 22:42:46+00:00)
Title: Fix rails rake tasks under spring

I have a rails app with solr_rails and I use the [spring](https://github.com/rails/spring) rails preloader to make running rake, rails and rspec quicker.

Since adding the sunspot_rails gem to the Gemfile, I get this error when running any rake task under spring:

```
$ spring rake db:migrate --trace
undefined method `=~' for #
/Users/daniel/work/myapp/Rakefile:6:in `'
/Users/daniel/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/sunspot_rails-2.1.0/lib/sunspot/rails/tasks.rb:75:in `block in sunspot_solr_in_load_path?'
```

Strangely it only happens under spring (running `rake db:migrate` normally works fine).

Thanks! :heart: