undefined method `[]' for #

 如果你遇到undefined method `[]' for #<Enumerable::Enumerator>,可以将以下代码加入项目中:

 

unless '1.9'.respond_to?(:force_encoding)
  String.class_eval do
    begin
      remove_method :chars
    rescue NameError
    end
  end
end 

 

你可能感兴趣的:(undefined)