I am unable to run unit tests for my Ruby on Rails application. I have JRuby 1.6.4 on Windows 7 x64 and 32x – both environments encounter the same problem.
When I issue the “rake test” command the output is as follows:
JRuby limited openssl loaded. http://jruby.org/openssl
gem install jruby-openssl for full support.
rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+)
WARNING: Global access to Rake DSL methods is deprecated. Please include
... Rake::DSL into classes and modules which use the Rake DSL methods.
WARNING: DSL method TrainerWeb::Application#task called at C:/Program Files/jruby-1.6.4/lib/ruby/gems/1.8/gems/railties-3.0.4/lib/rails/application.rb:214:in `initialize_tasks'
DEPRECATION WARNING: Rake tasks in D:/Work/P/Documents/NetBeansProjects/myproject/vendor/plugins/restful-authentication/tasks/auth.rake are deprecated. Use lib/tasks instead. (called from (root) at D:/Work/P/Documents/NetBeansProjects/myproject/Rakefile:13)
LoadError: no such file to load -- rake
require at org/jruby/RubyKernel.java:1038
(root) at C:/Program Files/jruby-1.6.4/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:1
LoadError: no such file to load -- rake
require at org/jruby/RubyKernel.java:1038
(root) at C:/Program Files/jruby-1.6.4/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:1
LoadError: no such file to load -- rake
require at org/jruby/RubyKernel.java:1038
(root) at C:/Program Files/jruby-1.6.4/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:1
Errors running test:units, test:functionals, test:integration!
For irb the “require ‘rake'” command gives following output:
irb(main):001:0> require 'rake'
LoadError: no such file to load -- rake
from org/jruby/RubyKernel.java:1038:in `require'
from (irb):1:in `evaluate'
from org/jruby/RubyKernel.java:1088:in `eval'
from C:/Program Files/jruby-1.6.4/lib/ruby/1.8/irb.rb:158:in `eval_input'
from C:/Program Files/jruby-1.6.4/lib/ruby/1.8/irb.rb:271:in `signal_status'
from C:/Program Files/jruby-1.6.4/lib/ruby/1.8/irb.rb:155:in `eval_input'
from org/jruby/RubyKernel.java:1419:in `loop'
from org/jruby/RubyKernel.java:1191:in `catch'
from C:/Program Files/jruby-1.6.4/lib/ruby/1.8/irb.rb:154:in `eval_input'
from C:/Program Files/jruby-1.6.4/lib/ruby/1.8/irb.rb:71:in `start'
from org/jruby/RubyKernel.java:1191:in `catch'
from C:/Program Files/jruby-1.6.4/lib/ruby/1.8/irb.rb:70:in `start'
from C:\Program Files\jruby-1.6.4\bin\irb:13:in `(root)'
My attempts to run tests in NetBeans produce another output:
Test-unit version : 2.4.5 loaded
JRuby limited openssl loaded. http://jruby.org/openssl
gem install jruby-openssl for full support.
rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+)
WARNING: Global access to Rake DSL methods is deprecated. Please include
... Rake::DSL into classes and modules which use the Rake DSL methods.
WARNING: DSL method TrainerWeb::Application#task called at C:/Program Files/jruby-1.6.4/lib/ruby/gems/1.8/gems/railties-3.0.4/lib/rails/application.rb:214:in `initialize_tasks'
DEPRECATION WARNING: Rake tasks in D:/Work/P/Documents/NetBeansProjects/myproject/vendor/plugins/restful-authentication/tasks/auth.rake are deprecated. Use lib/tasks instead. (called from (root) at D:/Work/P/Documents/NetBeansProjects/myproject/Rakefile:13)
'"C:/Program Files/jruby-1.6.4/bin/jruby.bat.exe"' is not recognized as an internal or external command,
operable program or batch file.
'"C:/Program Files/jruby-1.6.4/bin/jruby.bat.exe"' is not recognized as an internal or external command,
operable program or batch file.
'"C:/Program Files/jruby-1.6.4/bin/jruby.bat.exe"' is not recognized as an internal or external command,
operable program or batch file.
Errors running test:units, test:functionals, test:integration!
Finished in 0.0 seconds.
0 tests, 0 failures, 0 errors
Gemfile HAS a reference to rake.
I’ve found NO decent solution in Internet.
After I uninstalled JRuby and reinstalled it to C:\jruby-1.6.4 everything went Ok. So the problem was a space sign in the path.