Permission denied in tmp

前端 未结 10 2230
情书的邮戳
情书的邮戳 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 04:58

    I encountered this error recently. Apache was not able to write to tmp directory

    cannot generate tempfile /tmp/RackRewindableInput2xxxxxxxxxxxxxxxxx' /app-lib/lib/ruby/1.8/tempfile.rb:52:ininitialize' app-dir/vendor/gems/rack-1.0.1/lib/rack/rewindable_input.rb:73:in new' app-dir/vendor/gems/rack-1.0.1/lib/rack/rewindable_input.rb:73:inmake_rewindable' app-dir/vendor/gems/rack-1.0.1/lib/rack/rewindable_input.rb:26:in read' app-dir/vendor/gems/rack-1.0.1/lib/rack/request.rb:134:inPOST'

    I checked permission of tmp directory and it had permission to all groups to write to it. I changed owner of tmp directory and it didn't resolve the error either.

    The culprit was tmp directory was filled with too many large files, and looks like somehow apache didn't had enough space to write this new file. Cleared all temp and old files. It sorted out the issue.

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

    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.

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

    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
    
    0 讨论(0)
  • 2020-12-15 05:08

    You probably didn't create your Rails application with the user running the server now. Can you paste the output of ls -alh /srv/www/appname/tmp/cache/assets and tell us the user running the webserver ?

    0 讨论(0)
  • 2020-12-15 05:10
    1. Make the tmp folder of your project writable:

      chown -R group:user /path/to/rails/app/tmp
      chmod -R 777 /path/to/rails/app/tmp
      
    2. In your console, run rake tmp:cache:clear

    3. Restart your application.

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

    In my localhost it gave this error, and the command chmod 777 C:/Sites/project_name/tmp/cache/ solved my problem.

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