I have a Rakefile that looks like this:
require 'rspec/core/rake_task'
desc "Run all RSpec tests"
RSpec::Core::RakeTask.new(:spec)
This isn't working though. For example, if I try to run "rake -T", I get:
code/projects/bellybuster[master]% rake -T --trace
(in /Users/craig/code/projects/bellybuster)
rake aborted!
no such file to load -- rspec/core/rake_task
/Users/craig/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/Users/craig/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/Users/craig/code/projects/bellybuster/Rakefile:1:in `<top (required)>'
/Users/craig/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2383:in `load'
Any thoughts?
In case it might be helpful here's the Gemfile:
source :rubygems
gemspec
Oh and some versions:
- Ruby: 1.9.2p180
- Rake: 0.8.7
- Bundler: 1.0.13
- RubyGems: 1.7.2
The syntax looks fine to me. Are you 100% sure you have
rspec 2
installed? Does it appear withgem which rspec
? Maybe you forgot to runbundle install
or you don't listrspec
in the.gemspec
file as a (development) dependency?I just nuked my existing gem folder and re-installed everything by running
bundle install
. That solved the problem for me.Are you using Heroku?
I got the same problem, found this solution at The Fancy Manual:
Are you using Travis-CI? I fixed it by moving 'rake' from the gemspec to the Gemfile, i.e.:
Not sure if it is the correct solution, but it worked for me..