【Ruby学習メモ】英単語の複数形が探せない

Version

Notes

  • 以下のコマンドで英単語の複数形を確認しようとすると"NoMethodError"が出る。
irb
require 'active_support'
"cat".pluralize

Notes2(2011/05/07追記)

  • 以下のコマンドで英単語の複数形を確認しようとすると単数形が返ってくる。
irb
require 'active_support/core_ext/string'
"cat".pluralize
=> "cat"

topstoneさんにいただいたアドバイスを実行したところ、
"NoMethodError"を回避できた!あとは複数形になりさえすれば。。。

Notes3(2011/05/08追記)

  • やっぱり複数形を確認できない。

試しに、active_support\core_ext\string\inflections.rbから参照されている(と思われる)、
active_support\inflector\inflections.rbのpluralizeメソッドの最終行に、
「result = "Test!" # Test」を追加すると以下の結果に。

irb(main):001:0> require 'active_support/core_ext/string'
=> true
irb(main):002:0> "cat".pluralize
=> "Test!"
irb(main):003:0> exit

大変不本意だが、当面は「辞書」で暫定回避とする。