Actually I was mistaken, trying to isolate the bug from the rails app that it happened in it turned out that it was actually caused by  Kernel#__method__ being overriden by the aws-s3 gem in a broken way. Sorry for the distraction.