This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I have created a new Ruby Project containing just the following line of code: puts $LOAD_PATH Here the result: C:/xxxxx/Prototype/RubyApplication4/lib-IC:/xxxxx/Prototype/RubyApplication4/test C:/xxxxx/Prototype/RubyApplication4/spec C:/Program Files/Netbeans 6.9/ruby/jruby-1.5.0/lib/ruby/site_ruby/1.8 C:/Program Files/Netbeans 6.9/ruby/jruby-1.5.0/lib/ruby/site_ruby/shared C:/Program Files/Netbeans 6.9/ruby/jruby-1.5.0/lib/ruby/1.8 . as seen above the load path to the "lib" and the "test" directory got connected by a "-I" ans thus became invalid. As workaround I have figured out the following solutions: In the test_suite file add the path to the test directory by adding the line: $:.unshift File.join(File.dirname(__FILE__),'..','test') Example: ------------- begin -------------- require 'test/unit' require File.join(File.dirname(__FILE__),'..','test', 'test_lib' ) # Workaround for Netbeans 6.9 LOAD_PATH problem $:.unshift File.join(File.dirname(__FILE__),'..','test') # Add your testcases here require 'tc_1' require 'tc_2' --------------- end --------------- In each file accessing the lib directory from the test directory, add the line: $:.unshift File.join(File.dirname(__FILE__),'..','lib') Example: ------------- begin -------------- $:.unshift File.join(File.dirname(__FILE__),'..','lib') require 'test/unit' # For each file to be loaded from lib directory: require File.join(File.dirname(__FILE__),'..','lib', 'xyz_node' ) class Tc_1 < Test::Unit::TestCase def setup # started before executing each test case puts("------------------------------------------------------------------") end def test_dump_database_node() create_node = XYZ_node.new() end end --------------- end --------------- Please fix the loadpath. Maybe the invalid load path is caused by this line: rake aborted! Command failed with status (1): [C:/jruby-1.5.1/bin/jruby.bat -I"lib" -r"C:...] rake aborted! Note: Same error appears with build-in jruby and external jruby.
I have the same problem. It happens with JRuby, Ruby 1.8.7, Ruby 1.9.1 and Ruby 1.9.2, when running a specific test file. If I run the whole test suite of the project, it works fine because the path is built by Rake and not by NetBeans (I'm guessing). I confirm that a guilty "-I" appears in the Ruby path. The work-around proposed above works not only JRuby.
I had the same problem and workaround works for me. In my opinion this defect is a blocker for Ruby/JRuby development. It's a shame that is made its way to public release.
I have found additional workaround: Go to Project properties and in Souces Tab add second "lib" entry to your source folders and second "test" entry to your test folders. You duplicate paths, -I error still occurs, but it works as expected.