-
-
Notifications
You must be signed in to change notification settings - Fork 922
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Array.instance_methods different for jRuby inside Rails #4733
Comments
@straydogstudio by chance do you know if this behavior is the same with MRI 2.3.x? JRuby 9.1.x is not compatible with 2.4 (although we are working on that support) and it would be good to know if this a 2.3- or a 2.4 issue. |
@enebo I do not know. But I'll try to check on that in the next few days. |
I opened related issue here: #4723 @enebo @straydogstudio |
@bmulvihill ah great..I missed that. I could see prepend being responsible as it has caused other oddities since we impld it. |
I have not confirmed it but this should be fixed by the fixes for #4723. Please verify. |
Submitted this to Rails, they declined the issue as being a jRuby problem. Resubmitted here should you wish to address.
Description
Needed each_with_index in Array.instance_methods. Found it was missing (along with several other methods) within Rails when using jRuby 9.
Steps to reproduce
Using Docker:
To check MRI, replace the jruby image with ruby.
Expected behavior
Whether in our out of Rails, using MRI or jRuby, Array.instance_methods should return the same thing.
Actual behavior
When using jRuby 9 inside Rails 5.0, Array.instance_methods doesn't have each_cons, each_entry, each_with_index, each_with_object, as well as several other methods. They are present with MRI. Outside Rails they are present in jRuby.
This is the difference, which may contain some artifacts due to other required gem changes between MRI and jRuby:
System configuration
Rails version: 5.0.3 or 5.1.1
Ruby version: jRuby 9.1.10.0, MRI 2.4.1p111
Temporary fix
In
config/application.rb
, right before theBundler.require*
statement, add:Other
Found because the Axlsx gem uses Array.instance_methods to delegate methods. When used inside Rails 5.0 with jRuby it fails. See randym/axlsx#533
Submitted and declined as a Rails issue: rails/rails#29329
The text was updated successfully, but these errors were encountered: