Hi All,
I got the following issue with RSpec::Core::RakeTask when trying
upgrade from JRuby-1.6.8 to 1.7.3 (and having same issue on 1.7.1, 1.7.2
and 1.7.0 too). I am using jruby-rake-plugin (maven) to install gems
and execute rspec tests. It works great on JRuby 1.6.7.2 and 1.6.8 but
failed with following error with JRuby 1.7.x. I then tried to compare
the version of the gems installed of the two versions and they are
exactly the same version. I remove all of our spec tests leaving just
a trivial one (like true.should be_true) and the error still came. I
then try to run that simple spec alone directly (not via rake file)
using the jruby complete jar and it works.
So looks like my rake task is the problem when it run on JRuby-1.7.x
complete jar. I tried to search around for a day but it looks like no
one is having a same issue like me with JRuby 1.7.x. So I think it
should not be a bug of JRuby. I am leaning toward the thought is that
this is actually not a an issue for everybody but very curious to know
why just a simple combination (Jruby-complete jar, rake and rspec) could
fail. Is there anybody out there doing a same thing like me (and
successful)?
Here is my RakeTask file, it is actually stupid simple:
RSpec::Core::RakeTask.new do |t|
t.pattern = ‘*_spec.rb’
t.verbose = true
end
task :default => :spec
And here are version of gems:
diff-lcs-1.2.2
rake-10.0.4
rspec-2.13.0
rspec-core-2.13.1
rspec-expectations-2.13.0
rspec-mocks-2.13.0
And the error trace:
[INFO] — jruby-rake-plugin:1.7.3:rake (ruby_rspec_test) @ bayer-hco
[INFO] rake already installed
[WARNING] ** Invoke default (first_time)
[WARNING] ** Invoke spec (first_time)
[WARNING] ** Execute spec
[INFO]
file:/home/tmai/.m2/repository/org/jruby/jruby-complete/1.7.3/jruby-complete-1.7.3.jar!/META-INF/jruby.home/bin/jruby
-S rspec org_graph_spec.rb
[WARNING] rake aborted!
[WARNING]
file:/home/tmai/.m2/repository/org/jruby/jruby-complete/1.7.3/jruby-complete-1.7.3.jar!/META-INF/jruby.home/bin/jruby
-S rspec org_graph_spec.rb failed
[WARNING]
/home/tmai/.gem/jruby/1.9/gems/rspec-core-2.13.1/lib/rspec/core/rake_task.rb:156:in
run_task' [WARNING] /home/tmai/.gem/jruby/1.9/gems/rspec-core-2.13.1/lib/rspec/core/rake_task.rb:124:in
initialize’
[WARNING]
/home/tmai/.gem/jruby/1.9/gems/rake-10.0.4/lib/rake/file_utils_ext.rb:58:in
verbose' [WARNING] org/jruby/RubyBasicObject.java:1683:in
send’
[WARNING] org/jruby/RubyKernel.java:2107:in send' [WARNING] /home/tmai/.gem/jruby/1.9/gems/rspec-core-2.13.1/lib/rspec/core/rake_task.rb:122:in
initialize’
[WARNING] org/jruby/RubyProc.java:249:in call' [WARNING] /home/tmai/.gem/jruby/1.9/gems/rake-10.0.4/lib/rake/task.rb:246:in
execute’
[WARNING] org/jruby/RubyArray.java:1613:in each' [WARNING] /home/tmai/.gem/jruby/1.9/gems/rake-10.0.4/lib/rake/task.rb:241:in
execute’
[WARNING]
/home/tmai/.gem/jruby/1.9/gems/rake-10.0.4/lib/rake/task.rb:184:in
invoke_with_call_chain' [WARNING] jar:file:/home/tmai/.m2/repository/org/jruby/jruby-complete/1.7.3/jruby-complete-1.7.3.jar!/META-INF/jruby.home/lib/ruby/1.9/monitor.rb:211:in
mon_synchronize’
[WARNING]
/home/tmai/.gem/jruby/1.9/gems/rake-10.0.4/lib/rake/task.rb:177:in
invoke_with_call_chain' [WARNING] /home/tmai/.gem/jruby/1.9/gems/rake-10.0.4/lib/rake/task.rb:205:in
invoke_prerequisites’
[WARNING] org/jruby/RubyArray.java:1613:in each' [WARNING] /home/tmai/.gem/jruby/1.9/gems/rake-10.0.4/lib/rake/task.rb:203:in
invoke_prerequisites’
[WARNING]
/home/tmai/.gem/jruby/1.9/gems/rake-10.0.4/lib/rake/task.rb:183:in
invoke_with_call_chain' [WARNING] jar:file:/home/tmai/.m2/repository/org/jruby/jruby-complete/1.7.3/jruby-complete-1.7.3.jar!/META-INF/jruby.home/lib/ruby/1.9/monitor.rb:211:in
mon_synchronize’
[WARNING]
/home/tmai/.gem/jruby/1.9/gems/rake-10.0.4/lib/rake/task.rb:177:in
invoke_with_call_chain' [WARNING] /home/tmai/.gem/jruby/1.9/gems/rake-10.0.4/lib/rake/task.rb:170:in
invoke’
[WARNING]
/home/tmai/.gem/jruby/1.9/gems/rake-10.0.4/lib/rake/application.rb:143:in
invoke_task' [WARNING] /home/tmai/.gem/jruby/1.9/gems/rake-10.0.4/lib/rake/application.rb:101:in
top_level’
[WARNING] org/jruby/RubyArray.java:1613:in each' [WARNING] /home/tmai/.gem/jruby/1.9/gems/rake-10.0.4/lib/rake/application.rb:101:in
top_level’
[WARNING]
/home/tmai/.gem/jruby/1.9/gems/rake-10.0.4/lib/rake/application.rb:110:in
run_with_threads' [WARNING] /home/tmai/.gem/jruby/1.9/gems/rake-10.0.4/lib/rake/application.rb:95:in
top_level’
[WARNING]
/home/tmai/.gem/jruby/1.9/gems/rake-10.0.4/lib/rake/application.rb:73:in
run' [WARNING] /home/tmai/.gem/jruby/1.9/gems/rake-10.0.4/lib/rake/application.rb:160:in
standard_exception_handling’
[WARNING]
/home/tmai/.gem/jruby/1.9/gems/rake-10.0.4/lib/rake/application.rb:70:in
run' [WARNING] /home/tmai/.gem/jruby/1.9/gems/rake-10.0.4/bin/rake:33:in
(root)’
[WARNING] org/jruby/RubyKernel.java:1046:in load' [WARNING] /home/tmai/.gem/jruby/1.9/bin/rake:23:in
(root)’
[WARNING] Tasks: TOP => default => spec
Any feedback is appreciated.
Best Regards
Thang