Rails: “Permission denied - /tmp/cache/assets/development/sprockets/…”?

前端 未结 3 1962
谎友^
谎友^ 2021-01-21 00:36

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/devel         


        
相关标签:
3条回答
  • 2021-01-21 00:58

    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.

    0 讨论(0)
  • 2021-01-21 01:03

    I experienced this same issue.

    Permission denied @ apply2files

    The problem is that tmp directory in your application directory is not writable to the current user, that is, the current user does not have permission to write to the tmp directory in your application directory.

    Here's how I solved it:

    Simply delete the tmp directory in your application directory with superuser rights:

    sudo rm -rf tmp
    

    Do not recreate the tmp directory again, it's a waste of effort

    Simply start your application and the tmp directory will be created automatically again:

    rails s
    

    That's all.

    I hope this helps

    0 讨论(0)
  • 2021-01-21 01:04

    try this:

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

    chown -R nginx:nginx /www/rblpt/

    0 讨论(0)
提交回复
热议问题