Rake test task fails with LoadError when using Ruby version 2.2.1 [Mac OSX10.9]
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!
Rake::TestTask.new('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.