title: Stack level too deep when using carrierwave versions
body: <p>I'm trying to use a <a href="https://gist.github.com/mbajur/eea25199f67ac89ac348#file-extract_keyframes_worker-rb-L38">sidekiq worker</a>, which more or less saves a image file to database (using carrierwave). There are few files to save, which are a keyframes extracted from a video file. That's what that worker is about.</p>
  
  <p>My image uploader has a few versions defined and looks as follows:</p>
  
  <pre><code>class KeyframeUploader &lt; CarrierWave::Uploader::Base
  
    # ...
  
    # Keyframe thumbnail sizes
    version :small do
      process resize_to_fill: [180, 180], if: :square?
      process resize_to_fill: [320, 180], if: :not_square?
    end
  
    version :medium do
      process resize_to_fill: [460, 460], if: :square?
      process resize_to_fill: [640, 460], if: :not_square?
    end
  
    version :large do
      process resize_to_fill: [720, 720], if: :square?
      process resize_to_fill: [1280, 720], if: :not_square?
    end
  
  
    private
  
      # Checks if image is a square
      def square? file
        img = Magick::Image.read(file.path)
        img[0].columns == img[0].rows
      end
  
      # Oposite to #square?
      def not_square? file
        !square? file
      end
  
  end
  </code></pre>
  
  <p>The thing is, when i'm trying to run my Sidekiq Worker, it throws <code>Celluloid::FiberStackError: stack level too deep</code> and the only way to fix that is to remove my version definitions. It works only if there are not any version assigned to the uploader. </p>
  
  <p>I have tried moving a save process to another worker or using Carrierwave::Backgrounder but i'm allways getting the same result.</p>
  
  <p>Have you any idea what can i do about it?</p>
  
  <hr>
  
  <p>Edit: My stracktrace is:</p>
  
  <blockquote>
    <p>SystemStackError: stack level too deep    from
    /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/irb/workspace.rb:86</p>
  </blockquote>