Last night I was trying really hard to get MongoMapper to work with Paperclip via GridFS and failed. It seems right now Paperclip or even CarrierWave are not ready to be used with the latest MongoMapper drivers and GridFS (and I needed to use the latest drivers due to Scopify).

After giving up using GridFS, I wanted to use Paperclip with MongoMapper with the normal file system and I found this article from Ben Curtis, however with the latest version of Paperclip (version and MongoMapper (version 0.7.6) I was unsuccessful, kept getting:

Anonymous modules have no name to be referenced by

After reading the backtrace and diving into the paperclip source code I noticed that it was trying to use the ActiveRecord.logger and since I’ve removed ActiveRecord from my app, it was failing (with the odd error).

After some tweaking of Ben’s code, I came up with this: