A few days ago found a solution to this problem myself, so for the sake of completeness and (hopefully) to be of help to others, I will post my solution here.
The problem actually occurs because a Rails 3 Mountable Engine behaves a lot LIKE a normal Rails app, but also has a lot of minor/major differences. You just have to run bundle exec rake app:sunspot:solr:start
instead of just bundle exec rake sunspot:solr:start
.
So to get Sunspot working in a Rails 3 Mountable Engine, I followed these steps:
Add to Gemfile
# Gemfile (Don't forget to move them to your gemspec when packaging your engine)
gem 'sunspot_solr' #only for development mode
gen 'sunspot_rails'
After that, don't forget to run bundle install
to install the gems.
Configure your engine to use Sunspot/Solr
To generate the needed config/sunspot.yml
file run:
rails generate sunspot_rails:install
Start Solr on your local machine
Finally, to start a local instance of Solr run:
bundle exec rake app:sunspot:solr:start
And now you are all set!