I'm getting this error in Unicorn.log when trying to attach files with paper clip on my ubuntu virtual server app:
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'
In the controller I have
class Article < ActiveRecord::Base
has_attached_file :img,
url: "/system/:attachment/:id/:style/:filename",
validates_attachment_content_type :img, content_type: /\Aimage\/.*\Z/
end
If this info is not enough please comment where else the issue could reside, and I'll happily share more code.
Solved it. The problem was that the user that handles Rails on the virtual server didn't have all the access needed to generate files on behalf of paperclip in the app's folder. So I gave larger access to the folder using this terminal command:
$ sudo chmod -R 775 /RailsAppFolder