Report this

What is the reason for this report?

Permission denied on deploying Rails

Posted on October 27, 2014

Hi, I have successful deployed my Rails app on Ubuntu 14 but as I used active_admin gem so I got the below error with the stylesheet:

I, [2014-10-27T10:25:29.983751 #4242]  INFO -- :   Rendered vendor/bundle/ruby/2.1.0/bundler/gems/activeadmin-0173d95712a8/app/views/active_admin/devise/shared/_links.erb (2.0ms)
I, [2014-10-27T10:25:29.984013 #4242]  INFO -- :   Rendered vendor/bundle/ruby/2.1.0/bundler/gems/activeadmin-0173d95712a8/app/views/active_admin/devise/sessions/new.html.erb within layouts/active_admin_logged_out (167.9ms)
I, [2014-10-27T10:25:31.032396 #4242]  INFO -- : Completed 500 Internal Server Error in 1250ms
F, [2014-10-27T10:25:31.140842 #4242] FATAL -- : 
ActionView::Template::Error (Permission denied @ rb_sysopen - /home/rails/tmp/cache/assets/production/sprockets/2902b7df0c9e35fa9198cceb3b3001c3):
     6:   <title><%= [@page_title, render_or_call_method_or_proc_on(self, ActiveAdmin.application.site_title)].compact.join(" | ") %></title>
     7: 
     8:   <% ActiveAdmin.application.stylesheets.each do |style, options| %>
     9:     <%= stylesheet_link_tag style, options %>
    10:   <% end %>
    11:   <% ActiveAdmin.application.javascripts.each do |path| %>
    12:     <%= javascript_include_tag path %>

Not sure what permission should I have here? Could you please assist me with this? Cheers, Leo



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

A fix that worked for me was to clear the cache

rake tmp:cache:clear

@kingsleychi: Cheers, mate. That actually worked. Sorry for my super late response. All good now ;-)

Your app server can’t write the tmp directory of your application.

One solution would be making the group of the tmp folder the user that is running the app server and giving write permission to the group.

# Replace server with the name of the user running the app server.
chgrp -R server /home/rails/tmp
chmod -R g+w /home/rails/tmp

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.