NoMethodError: undefined method `key' for Hash
----------------------------------------------
Key: JRUBY-6107
URL: https://jira.codehaus.org/browse/JRUBY-6107
Project: JRuby
Issue Type: Bug
Components: JRuby-extras
Affects Versions: JRuby 1.6.4
Environment: mac osx lion
Reporter: Carlo Alberto Degli Atti
Using jruby-1.6.4 I get the next exception
jruby-1.6.4 > my_hash = { :a => 10 }
=> {:a=>10}
jruby-1.6.4 > my_hash.key 10
NoMethodError: undefined method `key' for {:a=>10}:Hash
from (irb):22:in `evaluate'
from org/jruby/RubyKernel.java:1088:in `eval'
from /Users/lordkada/.rvm/rubies/jruby-1.6.4/lib/ruby/1.8/irb.rb:158:in
`eval_input'
from /Users/lordkada/.rvm/rubies/jruby-1.6.4/lib/ruby/1.8/irb.rb:271:in
`signal_status'
from /Users/lordkada/.rvm/rubies/jruby-1.6.4/lib/ruby/1.8/irb.rb:155:in
`eval_input'
from org/jruby/RubyKernel.java:1419:in `loop'
from org/jruby/RubyKernel.java:1191:in `catch'
from /Users/lordkada/.rvm/rubies/jruby-1.6.4/lib/ruby/1.8/irb.rb:154:in
`eval_input'
from /Users/lordkada/.rvm/rubies/jruby-1.6.4/lib/ruby/1.8/irb.rb:71:in
`start'
from org/jruby/RubyKernel.java:1191:in `catch'
from /Users/lordkada/.rvm/rubies/jruby-1.6.4/lib/ruby/1.8/irb.rb:70:in
`start'
from
/Users/lordkada/.rvm/gems/jruby-1.6.4/gems/railties-3.1.0/lib/rails/commands/console.rb:45:in
`start'
from
/Users/lordkada/.rvm/gems/jruby-1.6.4/gems/railties-3.1.0/lib/rails/commands/console.rb:8:in
`start'
from
/Users/lordkada/.rvm/gems/jruby-1.6.4/gems/railties-3.1.0/lib/rails/commands.rb:40:in
`(root)'
from org/jruby/RubyKernel.java:1038:in `require'
from script/rails:6:in `(root)'
*WHILE* using ruby 1.9.2, it works as expected
ruby-1.9.2> my_hash = { :a => 10 }
=> {:a=>10}
ruby-1.9.2> my_hash.key 10
=> :a
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email