0
我已經安裝了這顆寶石 - https://github.com/pluskid/rmmseg-cpp。如何修復#<Enumerator:「錯誤的」未定義的方法長度「?
(文檔:http://rmmseg-cpp.rubyforge.org/)
當我嘗試運行此命令示例:$echo "我們都喜歡用 Ruby" | rmmseg
我得到:
/Users/webmagnets/.rvm/gems/[email protected]/gems/rmmseg-0.1.6/lib/rmmseg/algorithm.rb:24:in `next_token': undefined method `length' for #<Enumerator: "我們都喜歡用 Ruby\n":each_char> (NoMethodError)
from /Users/webmagnets/.rvm/gems/[email protected]/gems/rmmseg-0.1.6/lib/rmmseg/algorithm.rb:44:in `segment'
from /Users/webmagnets/.rvm/gems/[email protected]/gems/rmmseg-0.1.6/lib/rmmseg.rb:12:in `segment'
from /Users/webmagnets/.rvm/gems/[email protected]/gems/rmmseg-0.1.6/bin/rmmseg:65:in `<top (required)>'
from /Users/webmagnets/.rvm/gems/[email protected]/bin/rmmseg:23:in `load'
from /Users/webmagnets/.rvm/gems/[email protected]/bin/rmmseg:23:in `<main>'