Skip to content
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

"class is not compiled Ruby" error for string interpolation expression #5740

Closed
rsim opened this issue May 21, 2019 · 4 comments
Closed

"class is not compiled Ruby" error for string interpolation expression #5740

rsim opened this issue May 21, 2019 · 4 comments
Milestone

Comments

@rsim
Copy link

@rsim rsim commented May 21, 2019

Environment

  • jruby 9.2.7.0 (2.5.3) 2019-04-09 8a269e3 Java HotSpot(TM) 64-Bit Server VM 25.191-b12 on 1.8.0_191-b12 +jit [darwin-x86_64]

Expected Behavior

Create a file test.rb with a content

"#{123}"

And compile it and try to load:

jrubyc test.rb
jruby -e "load 'test.class'"

When using JRuby 9.2.6.0 then there are no error messages.

Actual Behavior

When using JRuby 9.2.7.0 it fails:

$ jrubyc test.rb
$ jruby -e "load 'test.class'"
LoadError: test.class is not compiled Ruby; use java_import to load normal classes
    load at org/jruby/RubyKernel.java:1022
  <main> at -e:1

This is a critical bug for our precompiled application as now loading of many precompiled Ruby files fails.

enebo added a commit that referenced this issue May 21, 2019
@enebo
Copy link
Member

@enebo enebo commented May 21, 2019

7dc0ae fully fixes the issue but I am trying to reason out how we should test this.

@enebo enebo added this to the JRuby 9.2.8.0 milestone May 21, 2019
@omegahm
Copy link

@omegahm omegahm commented May 23, 2019

Just to add to this the following two examples (as test.rb) work:

puts 123.to_s
puts "#{"123"}"

while this one gives the same error:

puts "#{123.to_s}"

@enebo
Copy link
Member

@enebo enebo commented May 23, 2019

@omegahm I am not seeing this with master:

system ~/work/jruby master 2188% cat test.rb
puts "#{456.to_s}"
system ~/work/jruby master 2189% jrubyc test.rb
system ~/work/jruby master 2190% jruby -I. -e 'load "./test.class"'
456

@enebo
Copy link
Member

@enebo enebo commented Jun 26, 2019

Original problem was solved and no response on second commenter. Closing as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants