Error in rails “Permission denied - /tmp/cache/assets/development/sprockets/…”?

末鹿安然 提交于 2019-12-24 01:19:01

问题


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/



来源:https://stackoverflow.com/questions/19364940/error-in-rails-permission-denied-tmp-cache-assets-development-sprockets

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!