I have an existing rails 3 project that works just fine on ruby 1.9.2-p290. However upgrading to ruby 1.9.3-p0 causes rake test
to spit out the following error:
/Users/zmanji/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:167:in `block in non_options': file not found: test/unit/**/*_test.rb (ArgumentError)
from /Users/zmanji/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:146:in `map!'
from /Users/zmanji/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:146:in `non_options'
from /Users/zmanji/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:207:in `non_options'
from /Users/zmanji/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:52:in `process_args'
from /Users/zmanji/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/minitest/unit.rb:891:in `_run'
from /Users/zmanji/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/minitest/unit.rb:884:in `run'
from /Users/zmanji/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:21:in `run'
from /Users/zmanji/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:326:in `block (2 levels) in autorun'
from /Users/zmanji/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:27:in `run_once'
from /Users/zmanji/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:325:in `block in autorun'
/Users/zmanji/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:167:in `block in non_options': file not found: test/functional/**/*_test.rb (ArgumentError)
from /Users/zmanji/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:146:in `map!'
from /Users/zmanji/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:146:in `non_options'
from /Users/zmanji/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:207:in `non_options'
from /Users/zmanji/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:52:in `process_args'
from /Users/zmanji/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/minitest/unit.rb:891:in `_run'
from /Users/zmanji/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/minitest/unit.rb:884:in `run'
from /Users/zmanji/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:21:in `run'
from /Users/zmanji/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:326:in `block (2 levels) in autorun'
from /Users/zmanji/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:27:in `run_once'
from /Users/zmanji/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:325:in `block in autorun'
It seems to be a consequence of this rake issue. However when I create a simple rails project on ruby 1.9.3 so such error occurs. What can I do to get my rails project to run on ruby 1.9.3?
Adding the test-unit gem worked for me.
Try the following (independently):
test.test_files = FileList['test/unit/**/test*.rb']
shoulda
beta dependency.test/unit
gem.The shoulda
gem is causing a general problem when using rake
in test environment on ruby 1.9.3, this is repported in this issue.
You can use this line
gem "shoulda", :require => false
in your Gemfile and then somewhere in your test code (e.g. test/test_helper.rb
if you are using test-unit) you can put
require 'shoulda'
If you are using rspec you should not use the shoulda
gem at all, you should use the shoulda-matchers
and this will not cause problems.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With