JRuby

undefined method `spec' for JRuby::Commands:Class (NoMethodError) with autotest

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: JRuby 1.1.6
  • Fix Version/s: JRuby 1.5
  • Component/s: Application Error
  • Labels:
    None
  • Environment:
    Ubuntu Linux, JDK 1.5, 1.6
  • Number of attachments :
    0

Description

Autotest gives an error in jruby that doesn't occur in MRI when a clean Rails 2.2.2 project is created:

$ jruby -S rails spectest

$ jruby script/generate rspec

$ jruby script/generate rspec_controller test index

$ export RSPEC=true

$ jruby -S autotest
loading autotest/rails_rspec
/home/rich/local/jruby/bin/jruby -S spec/views/test/index.html.erb_spec.rb spec/controllers/test_controller_spec.rb spec/helpers/test_helper_spec.rb -O spec/spec.opts
spec/views/test/index.html.erb_spec.rb:1: undefined method `spec' for JRuby::Commands:Class (NoMethodError)

Activity

Hide
Thomas E Enebo added a comment -

I am guessing -S spec/views/... is the real problem with this, so I am making it a subtask of the parent issue.

Show
Thomas E Enebo added a comment - I am guessing -S spec/views/... is the real problem with this, so I am making it a subtask of the parent issue.
Hide
Michael Guymon added a comment -

I have the same problem using JRuby 1.1.6 and Rails 2.2.2 with the rspec_on_rails plugin, where all the specs run under the normal jruby -S rake spec

/home/zinger/devel/src/java/jruby/jruby-1.1.6/bin/jruby -S script/spec -O spec/spec.opts spec/controllers/deploys_controller_spec.rb. . (test list omitted for brevity)
script/spec:1: undefined method `script' for JRuby::Commands:Class (NoMethodError)

The problem appears to be the -S and calling script/spec when executing the autospec. The 'script/spec' appears to be coming from vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb

class Autotest::RailsRspec < Autotest::Rspec

def spec_command
"script/spec"
end

end

I greped around ZenTest and could not figure how a -S is being added for JRuby. If you manually change rails_rspec.rb to "spec" (sans the "script/") the autospec execution runs farther, but died on another error:

/home/zinger/devel/src/java/jruby/jruby-1.1.6/bin/jruby -S spec -O spec/spec.opts spec/controllers/deploys_controller_spec.rb. . ..(test list omitted for brevity)
/home/zinger/devel/src/java/jruby/jruby-1.1.6/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:442:in `load_missing_constant': uninitialized constant Spec::VERSION::BUILD_TIME_UTC (NameError)

that is all the steam I have, hope it helps

Show
Michael Guymon added a comment - I have the same problem using JRuby 1.1.6 and Rails 2.2.2 with the rspec_on_rails plugin, where all the specs run under the normal jruby -S rake spec /home/zinger/devel/src/java/jruby/jruby-1.1.6/bin/jruby -S script/spec -O spec/spec.opts spec/controllers/deploys_controller_spec.rb. . (test list omitted for brevity) script/spec:1: undefined method `script' for JRuby::Commands:Class (NoMethodError) The problem appears to be the -S and calling script/spec when executing the autospec. The 'script/spec' appears to be coming from vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb class Autotest::RailsRspec < Autotest::Rspec def spec_command "script/spec" end end I greped around ZenTest and could not figure how a -S is being added for JRuby. If you manually change rails_rspec.rb to "spec" (sans the "script/") the autospec execution runs farther, but died on another error: /home/zinger/devel/src/java/jruby/jruby-1.1.6/bin/jruby -S spec -O spec/spec.opts spec/controllers/deploys_controller_spec.rb. . ..(test list omitted for brevity) /home/zinger/devel/src/java/jruby/jruby-1.1.6/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:442:in `load_missing_constant': uninitialized constant Spec::VERSION::BUILD_TIME_UTC (NameError) that is all the steam I have, hope it helps
Hide
Thomas E Enebo added a comment -

This was fixed along with JRUBY-3256. There could be other issues with autotest/ZenTest, but not because of -S (I ran through the steps described and did not get a stack to show up either).

Show
Thomas E Enebo added a comment - This was fixed along with JRUBY-3256. There could be other issues with autotest/ZenTest, but not because of -S (I ran through the steps described and did not get a stack to show up either).
Hide
Hiro Asari added a comment -

If OP still wants autotest to work with JRuby, I worked on it a while ago: http://github.com/BanzaiMan/zentest-jruby

The patch has not been taken upstream, since Ryan Davis is planning an overhaul in some parts, apparently.

Show
Hiro Asari added a comment - If OP still wants autotest to work with JRuby, I worked on it a while ago: http://github.com/BanzaiMan/zentest-jruby The patch has not been taken upstream, since Ryan Davis is planning an overhaul in some parts, apparently.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: