0

I have set up and Elastic Beanstalk instance, where I'm running Ruby 2.1 with Passenger. My app uses WicketPDF gem to generate PDF files from HTML.

How do i make a script or an config file in .ebextensions that handles these permissions on after deploy hook.

I have no idea how to write the commands to enable my Rails app, to have the necessary permissions.

This is the error given:

ActionView::Template::Error: Permission denied @ unlink_internal - ./.sass-     cache/4cf4513a295495886c7f76b542d7ea7acf7dc73a/(__TEMPLATE__)c
zPrima
  • 727
  • 1
  • 8
  • 20
  • did you try giving permission of the `cache` directory to the `deployer` user ? – Shiva Oct 07 '15 at 13:38
  • i tried sudo chmod 0777 -R on the tmp directory, but it does not work. Don't think i have a deployer user, just ec2-user and root – zPrima Oct 07 '15 at 13:41
  • make sure the `tmp` dir has read/write permission for `ec2-user`.. I usually check this using `ls -la` – Shiva Oct 07 '15 at 13:51
  • looks like it does, but for user webapp. `drwxrwxrwx 4 webapp webapp 4096 Oct 7 13:20 tmp` – zPrima Oct 07 '15 at 13:56
  • ok, it looks like there was a .sass-cache in app root directory, after removing it, it works, the questions is now how the heck :) – zPrima Oct 07 '15 at 14:00
  • so i restarted the app server on ec2 instance, now i have to manually set the chmod on cache folder again so that the Rails.cache.clear command works :/ – zPrima Oct 07 '15 at 14:05
  • See this : http://stackoverflow.com/questions/14934800/why-does-sass-cache-folder-get-created – Shiva Oct 07 '15 at 14:07

1 Answers1

0

Sass created a .sass-cache folder in root dir of my Rails app, after deleting it, the wicket gem created the pdf no problem.

Thanks @illusionist

zPrima
  • 727
  • 1
  • 8
  • 20