0

Here is error in my rails app, using nginx on production. How to solve this permissions issue? style.scss.css file is in subfolder voyage, maybe this has some effect? - but style.scss.erb renamed to style.css.erb works well!

F, [2014-10-27T16:59:57.605973 #790] FATAL -- : 
ActionView::Template::Error (Permission denied - /var/www/viewer/tmp/cache/assets/production/sass/f343497db8856b02b621e5e7a375554bcb8decb5
  (in /var/www/viewer/app/assets/stylesheets/voyage/style.scss.erb)):
    15:         %>
    16:         <link rel="icon" type="image/png" href="<%= url_for @logo.dynamic_attachment_url("64x64#") %>">
    17:   <% end %>
    18:   <%= stylesheet_link_tag "voyage/style", media: "all" %>
    19:   <%= stylesheet_link_tag "voyage/shadowbox", media: "all" %>
    20:   <%= javascript_include_tag "voyage/voyage" %>
    21:   <%= javascript_include_tag "voyage/shadowbox" %>
  app/views/layouts/voyage.html.erb:18:in `_app_views_layouts_voyage_html_erb__471689782555352934_45021440'
Gediminas Šukys
  • 7,101
  • 7
  • 46
  • 59

1 Answers1

1

I would refer you to the answer in this question.

To quote user Adam Emberlin:

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

You might what to Google for information on nginx user permissions.

Community
  • 1
  • 1
Thermatix
  • 2,757
  • 21
  • 51
  • yes, `/tmp/cache/assets` exist. But I noticed, that /tmp/cache/assets/production has 777 permissions, but /tmp/cache/assets/prooduction/sass/ has 755. Maybe this can be an issue? – Gediminas Šukys Oct 27 '14 at 15:23
  • what's the file permission read out of `style.sass.erb` look like? as in, `ls -l` of the file? – Thermatix Oct 27 '14 at 15:49
  • here it is `-rw-r--r-- 1 root root 10827 Oct 27 19:13 /var/www/viewer/app/assets/stylesheets/voyage/style.scss.erb` – Gediminas Šukys Oct 27 '14 at 17:15
  • There's the problem, it can't be executed by any one, the last one should be `r-x`. try `chmod -R 777 /var/www/` – Thermatix Oct 27 '14 at 17:42
  • there is permissions from other app scss in the same server, which works: `-rw-r--r-- 1 root root 12447 Aug 18 18:56 /var/www/becomr/app/assets/stylesheets/application.scss.erb` (but it is not in a subfolder) – Gediminas Šukys Oct 27 '14 at 17:46