Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Not A Bug
-
Affects Version/s: JRuby 1.1.1
-
Fix Version/s: JRuby 1.2
-
Component/s: Core Classes/Modules
-
Labels:None
-
Testcase included:yes
Description
Discovered while trying to run a Rails project under JRuby. The project makes use of ActiveScaffold and a second plugin that extends ActiveScaffold.
AS uses autoload for all the files in its library.
The second plugin extends one of the classes in AS in the following way:
module Foo::Bar
class Baz
def a_method_new
end
alias_method_chain :a_method, :new
end
end
This works in MRI but in JRuby, the Foo::Bar::Baz class is not autoloaded and the alias causes the application to crash with an "undefined method" NameError
Attached is a test case that demonstrates the problem. Expand the zip into the vendor/plugins directory of a new rails project and attempt to start the project via jruby script/server
Can you try this out again on trunk and 1.0 branch and see if it's still a problem? There have been a few autoload-related fixes since you reported this.