Sorry folks, because I know this has been asked before but I don’t
remember anyone giving enough detail for me to sort this out the way I
How do I change my rake tasks to silently fail if they can’t require
I can do this:
... the whole Rake task ...
puts “Unable to load RSpec - do you need to install the gem?”
… but that seems insane to have to indent all the code inside that
big begin / rescue block. I’m sure there’s a way to exit the script
without causing the whole rake loading chain to fail, but what is it?
I tried ‘exit 0’ but that seems to exit the whole process.
So I guess this is more a Ruby question than an RSpec question really,
but I’m sure a good answer will help a few other people out too.