Michael Zelensky
Michael Zelensky

Reputation: 2132

Rails/Paperclip Errno::EACCESS (Permission denied)

I'm working on Rails app with Paperclip gem used to save users' avatars. Production environment, FreeBSD, Apache, MySQL.

When saving user profile with an avatar file specified - the Permission denied errors appears.

I set 777 permission to all Paperclip directories - it didn't help.

Please help!

Thanks!

config/environments/production.rb

Paperclip.options[:command_path] = '/usr/local/bin' 

app/models/user.rb

has_attached_file :avatar, :styles => { :medium => "300x180>", :thumb => "40x40>" }

Upvotes: 4

Views: 3878

Answers (1)

Michael Zelensky
Michael Zelensky

Reputation: 2132

The answer is quite simple (as always). Change the owner of the public directory to www (was root):

$ chown -R www public

Upvotes: 4

Related Questions