5

I have a permissions problem. Using wickedpdf on my rails app to print, it produces tmp assets files into the dir /tmp/cache/assets. The files that it writes, like this one sprockets%2F2c9f9e326ac1c7cd3f07a1a3c9051874 have owner="nobody" and permissions="rw--------" so the asset wickedpdf gives an error while printing.

It's possible to correct this with a simple chmod -R 777 /tmp but i can't do this everytime the asset produces a new subdirectory into /tmp with no permissions. It's possible to set tmp dir and its subdirectories and files with all permissions for ever, also for new files that my assets will produce in future?

Paolo Moretti
  • 54,162
  • 23
  • 101
  • 92
DARIODF
  • 51
  • 4
  • Addressed in http://stackoverflow.com/questions/7524262/permission-denied-in-tmp – Prakash Murthy Oct 30 '12 at 14:24
  • 1
    Sorry but it's not the same problem. I need a different solution. – DARIODF Nov 12 '12 at 15:53
  • Are you running in apache or ngnix? Can you tell us the web server user, for example in apache is www-data, so one of the solution is assign permissions to this user in the folder. – rderoldan1 Oct 16 '13 at 14:19

2 Answers2

1

you can change permission for all the files and sub directories in temp/ directory,

like: chmod -R 777 /tmp/*

Sarwan Kumar
  • 1,283
  • 9
  • 24
0

There can be cache problems if you are using puma or rails very often.

I was facing same problem when switching from > puma to > rails s to start rails app.

Solution: You can delete cache for assets manually inside tmp/cache/ path

Jaswinder
  • 1,455
  • 14
  • 27