title: Rails4 Mongoid Paperclip does not upload file, but everything else
body: <p>I have a Rails4 Project Using Mongoid and Mongoid-Paperclip.
  I have ImageMagick just set up and the commands seem to work.
  The Model, that holds the image gets created, all the image fields get filled.
  The only thing that does not work is the copying of the files to the public/system/... folder (In development mode on my mac).</p>
  
  <p>Here is the Code and output:</p>
  
  <p>Catalog Image (embedded by Part)</p>
  
  <pre><code>class CatalogImage
    include Mongoid::Document
    include Mongoid::Paperclip
  
    field :caption
  
    embedded_in :part, inverse_of: :catalog_images
    has_mongoid_attached_file :image,
        :path =&gt; ":rails_root/public/system/:attachment/:id/:style/:filename",
        :url =&gt; "/system/:attachment/:id/:style/:filename",
        :styles =&gt; { :small =&gt; "200x200&gt;", :medium =&gt; "500x500&gt;" }
    validates_attachment_content_type :image, :content_type =&gt; %w(image/jpeg image/jpg image/png)
  end
  </code></pre>
  
  <p>Part (Embeds many catalog images)</p>
  
  <pre><code>class Part
    include Mongoid::Document
    field :name
    field :description
    field :price
    field :clickout
  
    embeds_many :catalog_images
  
    accepts_nested_attributes_for :catalog_images
  
  end
  </code></pre>
  
  <p>Gemfile</p>
  
  <pre><code>...
  gem 'mongoid', '4.0.0.beta1', github: 'mongoid/mongoid'
  gem 'bson_ext'
  
  gem "mongoid-paperclip", :require =&gt; "mongoid_paperclip", :git =&gt; "git://github.com/meskyanichi/mongoid-paperclip.git", :branch =&gt; "develop"
  ...
  </code></pre>
  
  <p>Output</p>
  
  <pre><code>Started POST "/parts" for 127.0.0.1 at 2014-02-18 23:19:02 +0100
  Processing by PartsController#create as HTML
    Parameters: {"utf8"=&gt;"✓", "authenticity_token"=&gt;"io4UetDC8hkUxDzJsZWSL639P8fTcEvrQ9HyEjPc5x0=", "part"=&gt;{"name"=&gt;"FOE", "description"=&gt;"", "price"=&gt;"", "clickout"=&gt;"", "catalog_images_attributes"=&gt;{"0"=&gt;{"caption"=&gt;"", "image"=&gt;#&lt;ActionDispatch::Http::UploadedFile:0x007f8b3bf79ec8 @tempfile=#&lt;Tempfile:/tmp/RackMultipart20140218-3774-mrhq7e&gt;, @original_filename="GOPR0041.JPG", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"part[catalog_images_attributes][0][image]\"; filename=\"GOPR0041.JPG\"\r\nContent-Type: image/jpeg\r\n"&gt;}, "1"=&gt;{"caption"=&gt;""}, "2"=&gt;{"caption"=&gt;""}}, "user_images_attributes"=&gt;{"0"=&gt;{"caption"=&gt;""}, "1"=&gt;{"caption"=&gt;""}, "2"=&gt;{"caption"=&gt;""}}}, "commit"=&gt;"Create Part"}
    MOPED: 127.0.0.1:27017 COMMAND      database=admin command={:ismaster=&gt;1} runtime: 0.8190ms
    MOPED: 127.0.0.1:27017 QUERY        database=parti_development collection=users selector={"$query"=&gt;{"_id"=&gt;BSON::ObjectId('53013f31656c2d8c48010000')}, "$orderby"=&gt;{:_id=&gt;1}} flags=[] limit=-1 skip=0 batch_size=nil fields=nil runtime: 18.5110ms
  USER ROLE: admin
  Command :: file -b --mime-type '/tmp/2a5dd22ac67a08cdb0f94370de8f2c2d20140218-3774-du97lf'
  Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/7f1e25f793533e2ad330a62c15c3d4b320140218-3774-b7ktx4[0]' 2&gt;/dev/null
  Command :: identify -format %m '/tmp/7f1e25f793533e2ad330a62c15c3d4b320140218-3774-b7ktx4[0]'
  Command :: convert '/tmp/7f1e25f793533e2ad330a62c15c3d4b320140218-3774-b7ktx4[0]' -auto-orient -resize "200x200&gt;" '/tmp/7f1e25f793533e2ad330a62c15c3d4b320140218-3774-b7ktx420140218-3774-17toiy6'
  Command :: file -b --mime '/tmp/7f1e25f793533e2ad330a62c15c3d4b320140218-3774-b7ktx420140218-3774-17toiy6'
  Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/7f1e25f793533e2ad330a62c15c3d4b320140218-3774-b7ktx4[0]' 2&gt;/dev/null
  Command :: identify -format %m '/tmp/7f1e25f793533e2ad330a62c15c3d4b320140218-3774-b7ktx4[0]'
  Command :: convert '/tmp/7f1e25f793533e2ad330a62c15c3d4b320140218-3774-b7ktx4[0]' -auto-orient -resize "500x500&gt;" '/tmp/7f1e25f793533e2ad330a62c15c3d4b320140218-3774-b7ktx420140218-3774-w165tz'
  Command :: file -b --mime '/tmp/7f1e25f793533e2ad330a62c15c3d4b320140218-3774-b7ktx420140218-3774-w165tz'
  Command :: file -b --mime-type '/tmp/ba4ac90ea15781053d509930934cc4ba20140218-3774-lxfnx3'
    MOPED: 127.0.0.1:27017 INSERT       database=parti_development collection=parts documents=[{"_id"=&gt;BSON::ObjectId('5303dc56456c2d0ebe000000'), "name"=&gt;"FOE", "description"=&gt;"", "price"=&gt;"", "clickout"=&gt;"", "catalog_images"=&gt;[{"_id"=&gt;BSON::ObjectId('5303dc56456c2d0ebe010000'), "caption"=&gt;"", "image_file_name"=&gt;"GOPR0041.JPG", "image_content_type"=&gt;"image/jpeg", "image_file_size"=&gt;202999, "image_fingerprint"=&gt;"4ad738adc42cfc8305f415a906c323a8", "image_updated_at"=&gt;2014-02-18 22:19:02 UTC}, {"_id"=&gt;BSON::ObjectId('5303dc56456c2d0ebe020000'), "caption"=&gt;""}, {"_id"=&gt;BSON::ObjectId('5303dc56456c2d0ebe030000'), "caption"=&gt;""}], "user_images"=&gt;[{"_id"=&gt;BSON::ObjectId('5303dc56456c2d0ebe040000'), "caption"=&gt;""}, {"_id"=&gt;BSON::ObjectId('5303dc56456c2d0ebe050000'), "caption"=&gt;""}, {"_id"=&gt;BSON::ObjectId('5303dc56456c2d0ebe060000'), "caption"=&gt;""}]}] flags=[]
                           COMMAND      database=parti_development command={:getlasterror=&gt;1, :w=&gt;1} runtime: 3.3530ms
  Redirected to http://localhost:3000/parts/5303dc56456c2d0ebe000000
  Completed 302 Found in 342ms (ActiveRecord: 0.0ms)
  
  
  Started GET "/parts/5303dc56456c2d0ebe000000" for 127.0.0.1 at 2014-02-18 23:19:02 +0100
  Processing by PartsController#show as HTML
    Parameters: {"id"=&gt;"5303dc56456c2d0ebe000000"}
    MOPED: 127.0.0.1:27017 QUERY        database=parti_development collection=parts selector={"_id"=&gt;BSON::ObjectId('5303dc56456c2d0ebe000000')} flags=[] limit=0 skip=0 batch_size=nil fields=nil runtime: 0.4620ms
    Rendered parts/show.html.erb within layouts/application (9.1ms)
  Completed 200 OK in 16ms (Views: 13.9ms | ActiveRecord: 0.0ms)
  
  
  Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2014-02-18 23:19:02 +0100
  
  
  Started GET "/assets/scaffolds.css?body=1" for 127.0.0.1 at 2014-02-18 23:19:02 +0100
  
  
  Started GET "/assets/parts.css?body=1" for 127.0.0.1 at 2014-02-18 23:19:02 +0100
  
  
  Started GET "/assets/comments.css?body=1" for 127.0.0.1 at 2014-02-18 23:19:02 +0100
  
  
  Started GET "/assets/main.css?body=1" for 127.0.0.1 at 2014-02-18 23:19:02 +0100
  
  
  Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2014-02-18 23:19:02 +0100
  
  
  Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2014-02-18 23:19:02 +0100
  
  
  Started GET "/assets/turbolinks.js?body=1" for 127.0.0.1 at 2014-02-18 23:19:02 +0100
  
  
  Started GET "/assets/comments.js?body=1" for 127.0.0.1 at 2014-02-18 23:19:02 +0100
  
  
  Started GET "/assets/parts.js?body=1" for 127.0.0.1 at 2014-02-18 23:19:02 +0100
  
  
  Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2014-02-18 23:19:02 +0100
  
  
  Started GET "/system/images/5303dc56456c2d0ebe010000/medium/GOPR0041.JPG?1392761942" for 127.0.0.1 at 2014-02-18 23:19:02 +0100
  
  ActionController::RoutingError (No route matches [GET] "/system/images/5303dc56456c2d0ebe010000/medium/GOPR0041.JPG"):
    actionpack (4.0.2) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
    actionpack (4.0.2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
    railties (4.0.2) lib/rails/rack/logger.rb:38:in `call_app'
    railties (4.0.2) lib/rails/rack/logger.rb:20:in `block in call'
    activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `block in tagged'
    activesupport (4.0.2) lib/active_support/tagged_logging.rb:25:in `tagged'
    activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `tagged'
    railties (4.0.2) lib/rails/rack/logger.rb:20:in `call'
    actionpack (4.0.2) lib/action_dispatch/middleware/request_id.rb:21:in `call'
    rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
    rack (1.5.2) lib/rack/runtime.rb:17:in `call'
    activesupport (4.0.2) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
    rack (1.5.2) lib/rack/lock.rb:17:in `call'
    actionpack (4.0.2) lib/action_dispatch/middleware/static.rb:64:in `call'
    rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
    railties (4.0.2) lib/rails/engine.rb:511:in `call'
    railties (4.0.2) lib/rails/application.rb:97:in `call'
    rack (1.5.2) lib/rack/lock.rb:17:in `call'
    rack (1.5.2) lib/rack/content_length.rb:14:in `call'
    rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
    /usr/local/opt/rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
    /usr/local/opt/rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
    /usr/local/opt/rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
  </code></pre>
  
  <p>Thanks in Advance, 
  Steff</p>