Bug #11041

Rake test task fails with LoadError when using Ruby version 2.2.1 [Mac OSX10.9]

Added by TheNephilim (Paul Yeboah) about 5 years ago. Updated 12 months ago.

Target version:
ruby -v:
2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin12.0]


I have just started to use RVM and have installed ruby version 2.2.1. I have a test project whose Rake test task that I was successfully executing tests with the system version (2.0.0). When I then switch to 2.2.1 via RVM, the rake_test_loader fails with a LoadError.

Initially, I thought there were 3 possible problems that cause this issue:

1) different version of Ruby in use
2) RVM environment is causing a problem
3) there is a problem with RVM and Rake

However, I have managed to rule out 2 and 3 (if I use the previous stable version of Ruby, v2.1.5 as listed on the ruby site, then the problem goes away).

I raised a stackoverflow question about this to see if anyone knows about this, but so far no luck; see the following link:

My test project is structured as a standard Ruby gem and the Rake file with which a launch the rake test task is:

`($LOAD_PATH << File.expand_path("../lib", FILE)).uniq!

require 'rake/testtask'
require 'rdoc/task'
require 'rubygems/package_task''test') do |t|
t.pattern = 'test/**/*tests.rb'
t.warning = true

task "default" => ["test"]`

I displayed the $LOAD_PATH when the tests are run under system ruby version 2.0.0 and RVM ruby version 2.2.1

$LOAD_PATH when tests fail under RVM ruby version 2.2.1:


$LOAD_PATH when tests pass under 2.0.0:


The root of the project is /Users/Sancho/dev/git/joy/

Tests are located at /Users/Sancho/dev/git/joy/test/.../*_tests.rb

Code under test located at /Users/Sancho/dev/git/joy/lib/joy/.../*.rb

I've tested the same project against various versions of ruby (2.0.0, 2.1.1, 2.1.5) and the only version that has a problem is version 2.2.1.

Please let me know if I can provide you with more information, thanks.


Updated by TheNephilim (Paul Yeboah) about 5 years ago

NB: The ruby version listed as ruby -v is incorrect. The correct value should be:
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14]


Updated by jeremyevans0 (Jeremy Evans) 12 months ago

  • Status changed from Open to Closed

Also available in: Atom PDF