Catfish
Catfish

Reputation: 19294

Travis-ci build fails with rake aborted! LoadError: cannot load such file -- rspec/core/rake_task

I'm trying to add travis-ci to my project and it keeps failing with

rake aborted! 
LoadError: cannot load such file -- rspec/core/rake_task

I'm currently using rspec 3.1

Any ideas as to why this is failing and how to fix it?

Here's my project that's failing: https://github.com/toymachiner62/readable_date_ranges/tree/tests

EDIT

Using worker: worker-linux-9-2.bb.travis-ci.org:travis-linux-4
system_info
Build system information
Build language: ruby
git.checkout
0.62s$ git clone --depth=50 --branch=master git://github.com/toymachiner62/readable_date_ranges.git toymachiner62/readable_date_ranges
Cloning into 'toymachiner62/readable_date_ranges'...
remote: Counting objects: 77, done.
remote: Compressing objects: 100% (44/44), done.
remote: Total 77 (delta 28), reused 71 (delta 26)
Receiving objects: 100% (77/77), 13.73 KiB | 0 bytes/s, done.
Resolving deltas: 100% (28/28), done.
Checking connectivity... done.
$ cd toymachiner62/readable_date_ranges
$ git checkout -qf e78f9f7f350c2cfbb2ffb7751024a1bbb6ed732f
rvm
0.36s$ rvm use 1.9.3 --install --binary --fuzzy
Using /home/travis/.rvm/gems/ruby-1.9.3-p550
$ ruby --version
ruby 1.9.3p550 (2014-10-27 revision 48165) [x86_64-linux]
$ rvm --version
rvm 1.26.0 (master) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]
$ bundle --version
Bundler version 1.7.4
$ gem --version
2.4.2
0.82s$ rake
rake aborted!
LoadError: cannot load such file -- rspec/core/rake_task
/home/travis/build/toymachiner62/readable_date_ranges/Rakefile:2:in `<top (required)>'
/home/travis/.rvm/gems/ruby-1.9.3-p550/bin/ruby_executable_hooks:15:in `eval'
/home/travis/.rvm/gems/ruby-1.9.3-p550/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)
The command "rake" exited with 1.
Done. Your build exited with 1.

Upvotes: 4

Views: 2744

Answers (2)

vagdevi k
vagdevi k

Reputation: 1676

My travis build too was aborted with the same error saying rake aborted.

To solve the issue, makesure to add the language attribute based on your application in your travis file.

If no language is needed, add generic language:

language: generic

For your ref, use this.

Upvotes: 0

Paulo Fidalgo
Paulo Fidalgo

Reputation: 22296

The problem is with your repository, after checkout you can see the differences:

Clone original repository:

git clone https://github.com/kevinkaske/readable_date_ranges.git kevinkaske_readable_date_ranges

Clone your own repository:

git clone https://github.com/toymachiner62/readable_date_ranges.git toymachiner62_readable_date_ranges

Now with tree, you can see that's some files missing in your repo, even if it's listed on github:

.
├── kevinkaske_readable_date_ranges
│   ├── GEMFILE
│   ├── lib
│   │   └── readable_date_ranges.rb
│   ├── LICENSE
│   ├── Rakefile
│   ├── readable_date_ranges.gemspec
│   ├── README.md
│   └── spec
│       ├── readable_date_ranges_spec.rb
│       └── spec_helper.rb
└── toymachiner62_readable_date_ranges
    ├── lib
    │   └── readable_date_ranges.rb
    ├── LICENSE
    ├── readable_date_ranges.gemspec
    └── README.md

So you don't have the Rakefile, which defines the rake tasks nor the spec directory.

EDIT

Add this to your .travis.yaml file:

# whitelist
branches:
  only:
    - test

Also try to put the travis YAML configuration file in the master branch.

Upvotes: 1

Related Questions