RSpec ships with a rake task with a number of useful options. We recommend you wrap this in a rescue clause so that you can use your Rakefile in an environment where RSpec is unavailable (for example on a production server). e.g: begin require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:spec) rescue LoadError end