Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Permission denied in tmp

Tags:

I just deployed a Rails 3 app with Ruby 1.9.2. I have been getting several errors.

  1. application.css wasn't compiled. so I set pre compilation in production.rb to false;
  2. Then I got: cannot generate tempfile, so I did rake tmp:clear;
  3. And now I get ActionView::Template::Error (Permission denied - /srv/www/appname/tmp/cache/assets): and I haven't been able to fix this one.

Please help.

like image 427
leonel Avatar asked Sep 23 '11 04:09

leonel


2 Answers

If the user:group running your web server is http:http and it's running on *nix, do this:

sudo chown -R http:http /srv/www/appname/ 

Also, silly question, but does /tmp/cache/assets exist?

And, if so, as @leonel points out, you may also need to change the permissions:

chmod 777 /srv/www/appname/tmp/cache 

Be careful setting 777 permissions on anything. Only do this to verify a permissions issue, then reset to the most minimal permissions necessary.

like image 200
Adam Eberlin Avatar answered Sep 23 '22 04:09

Adam Eberlin


Most likely you're running your app under apache passenger.

You have to change the owner of config/environment.rb to somebody who has permissions to your app's folder.

chown -R www-data:www-data /path/to/app 
like image 43
Vanuan Avatar answered Sep 20 '22 04:09

Vanuan