Thrift causing undefined method 'write_struct_begin' on all IO objects

StackOverflow https://stackoverflow.com/questions/22417485

  •  15-06-2023
  •  | 
  •  

Вопрос

I'm running into a strange error... After I call a thrift method, all file IO I try to do fails with errors like:

log writing failed. undefined method `write_struct_begin' 

This occurs if I try to do logger.info etc., or even if I just open a file directly, and try to write to it.

Totally stumped!

Это было полезно?

Решение

The problem was that the Thrift interface I was consuming defined a type called "File". As soon as I pulled in the generated Ruby code for this file it rewrote the built-in File class. It would be nice if ruby's thrift generator namespaced things better!

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top