Skip to content

Jruby 10.0: it is not working in REPL (irb/pry) #8796

@nsauk

Description

@nsauk

Environment Information

  • jruby 10.0.0.0 (3.4.2) 2025-04-13 6ed59bc OpenJDK 64-Bit Server VM 21.0.7 on 21.0.7 +indy +jit [arm64-darwin]
  • Darwin mac.local 24.3.0 Darwin Kernel Version 24.3.0: Thu Jan 2 20:24:06 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T8103 arm64

Expected Behavior

irb(main):001> 1.tap { it }
=> 1
[1] pry(main)> 1.tap { it }
=> 1

Actual Behavior

irb(main):001> 1.tap { it }
(irb):1:in 'block in evaluate': undefined local variable or method 'it' for main (NameError)
	from <internal:uri:classloader:/jruby/kernel/kernel.rb>:19:in 'tap'
	from (irb):1:in 'evaluate'
	from org/jruby/RubyKernel.java:1258:in 'eval'
	from org/jruby/RubyKernel.java:1658:in 'loop'
	from org/jruby/RubyKernel.java:1397:in 'catch'
	from /Users/nsauk/.rbenv/versions/jruby-10.0.0.0/lib/ruby/gems/shared/gems/irb-1.14.3/exe/irb:9:in '<main>'
	from org/jruby/RubyKernel.java:1212:in 'load'
	from /Users/nsauk/.rbenv/versions/jruby-10.0.0.0/bin/irb:25:in '<main>'
[1] pry(main)> 1.tap { it }
NameError: undefined local variable or method 'it' for main (NameError)
from (pry):1:in 'block in evaluate_ruby'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions