Error in rails “Permission denied - /tmp/cache/ass

2019-07-13 23:40发布

问题:

When I run a rails app and navigate with browser to them I get an error from rails:

Permission denied - /path/to/my_rails_app/tmp/cache/assets/development/sprockets/37b5a12047376b10a57191a10d3af30a rails error

And I have no such file/folders behind the ./tmp/. What is the problem?

回答1:

The user who created or 'owns" the my_rails_app directory isn't writable by the server.

chown -R webserveruser:webserveruser /path/to/my_rails_app

Change the webserveruser to http, or apache or whatever username is running your server. The entitiy to the right of the : is the group, use a group name that is writable by your user if you need write access without changing users.



回答2:

try this:

rm -rf public/assets rake assets:clean RAILS_ENV=development

chown -R nginx:nginx /www/rblpt/