From: Shin-ichiro HARA Date: 1998-03-04T22:20:17+09:00 Subject: [ruby-dev:1588] to_s called by method_missing 原です。 ときどきはまるんですが、method_missing はデフォルトで to_s を呼びますよね。これって to_s の再定義をミスした 時、ややこしいエラーメッセージを出すわけです。 -----^ test.rb class Foo def to_s hello end end foo = Foo.new print foo -----$ test.rb $ ./test.rb ./test.rb:4:in `method_missing': fatal: stack level too deep from ./test.rb:4:in `to_s' from ./test.rb:4:in `method_missing' from ./test.rb:4:in `to_s' from ./test.rb:4:in `method_missing' from ./test.rb:4:in `to_s' from ./test.rb:4:in `method_missing' from ./test.rb:4:in `to_s' from ./test.rb:4:in `method_missing' ... 4081 levels... from ./test.rb:4:in `method_missing' from ./test.rb:4:in `to_s' from ./test.rb:9:in `print' from ./test.rb:9 そこで method_missing の使う to_s は、再定義前のものにしたら どうかと思うのですがどうでしょう。