Ruby 1.9.1の私のバージョンには、「テストユニット」に依存する宝石がありました。少なくとも1台の がtest-unit-2.4.7のインストールを強制しました。私にとっては、 'test-unit-2.4.7' gemを削除することで問題は解決しました。
は、テストユニット-2.4.7では、私たちは、このコードがあります: '?ascii_compatible'
in /home/davei/.gem/ruby/1.9.1/gems/test-unit-2.4.7/lib/test/unit/assertions.rb
1483
1484 def ensure_diffable_string(string)
1485 if string.respond_to?(:encoding) and
=> 1486 !string.encoding.ascii_compatible?
1487 string = string.dup.force_encoding("ASCII-8BIT")
1488 end
1489 string
1490 end
はおそらくエンコードのすべてのインスタンスがサポートする必要がありますがただし、Ruby 1.9.1p378ではそうではありません。
(rdb:1) p string.encoding
#<Encoding:US-ASCII>
(rdb:1) p string.encoding.public_methods
[:to_s, :inspect, :name, :names, :dummy?, :_dump, :dbg, :pretty_print, :pretty_print_cycle, :pretty_print_instance_variables, :pretty_print_inspect, :nil?, :===, :=~, :!~, :eql?, :class, :clone, :dup, :taint, :tainted?, :untaint, :untrust, :untrusted?, :trust, :freeze, :frozen?, :methods, :singleton_methods, :protected_methods, :private_methods, :public_methods, :instance_variables, :instance_variable_get, :instance_variable_set, :instance_variable_defined?, :instance_of?, :kind_of?, :is_a?, :tap, :send, :public_send, :respond_to?, :extend, :display, :method, :public_method, :define_singleton_method, :hash, :__id__, :object_id, :to_enum, :enum_for, :gem, :pretty_inspect, :==, :equal?, :!, :!=, :instance_eval, :instance_exec, :__send__]
「ascii_compatible?」が見つかりました。エンコーディングのための欠落:UTF-8も同様です。
'person.rb'はどのように見えますか?具体的には8〜14行程度。 – Batkins
私の投稿にあるエラーメッセージの上のコードは 'person.rb'です – Omnipresent