title: Rails PaperClip Errno::EACCES (Permission denied @ dir_s_mkdir - ~rails
body: <p>I'm getting this error in Unicorn.log when trying to attach files with paper clip on my ubuntu virtual server app:</p>
  
  <pre><code>Completed 500 Internal Server Error in 312ms (ActiveRecord: 10.1ms)
  
  Errno::EACCES (Permission denied @ dir_s_mkdir - ~rails):
    app/controllers/articles_controller.rb:30:in `block in create'
    app/controllers/articles_controller.rb:29:in `create'
  </code></pre>
  
  <p>In the controller I have </p>
  
  <pre><code>class Article &lt; ActiveRecord::Base
      has_attached_file :img,
      url: "/system/:attachment/:id/:style/:filename",
      validates_attachment_content_type :img, content_type: /\Aimage\/.*\Z/
  end
  </code></pre>
  
  <p>If this info is not enough please comment where else the issue could reside, and I'll happily share more code.</p>