Saturday, December 1, 2012

CarrierWave::InvalidParameter (invalid cache id)

I'm using carrierwave to handle uploads for a project, a glorified lolcat generator. In my carrierwave uploader I had a processor that was calling model.save. My specs were passing but the app was throwing CarrierWave::InvalidParameter (invalid cache id) whenever I called recreate_versions!. I eventually tracked the cause of this down to calling model.save. It turns out that call was unnecessary. Carrierwave must do that for you. My specs were passing because I had processing turned off. config.enable_processing = false. Nobody else on the internets seemed to be having this problem. Hope it helps somebody.

1 comment:

Anonymous said...

Thank you! I was trying to fix this for hours, and this solution resolved my problem!