Permission denied in tmp

前端 未结 10 2231
情书的邮戳
情书的邮戳 2020-12-15 04:32

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 <
相关标签:
10条回答
  • 2020-12-15 05:16

    Now for those of us that are using windows - If you are an administrator and see this error

    ActionView::Template::Error (Permission denied @ utime_failed) C:/User/..../tmp/cache/assets/sprochets/v3.0/E5/E5PZx-mq8.cache
    

    Then it is Permission and Ownership setting issue on Windows. You can go to the tmp folder on your application and give yourself(User) permission to **Read, Write and Execute ** on the folder. Click [here][1] to view how to give permissions.

    Quick Fix. Open your terminal and run the following command as an administrator

        takeown /f <location of your app tmp folder> /r /d y
    

    Then Restart your server.

    0 讨论(0)
  • 2020-12-15 05:18

    We need to grant permissions to access the required directory for the system root user

    sudo chmod 777 -R your_project_directory_to_be_access
    

    In your case you can use:

    sudo chmod 777 -R /srv/www/appname/tmp/
    

    For security reasons, just keep in your mind:

    chmod 777 gives everybody read, write and execute rights which for most problems is definitively too much.

    0 讨论(0)
  • 2020-12-15 05:18

    I think a better solution without giving everyone manage rights to tmp folder is like that:

     sudo rake tmp:cache:clear
    

    This will clear the temp folder and when you run rails server again it won't give error.

    0 讨论(0)
  • 2020-12-15 05:19

    Most probably you gave permission to your app's main folder read and execute mode. However, in order to generate new files from your app, you also need to give write permission for required folder. For example: yUML uses tmp folder for generating files. I gave tmp folder write permission:

    chmod -R 777 /usr/share/nginx/html/yuml_product/tmp

    solved my problem.

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