Search code examples
ruby-on-railsrubyruby-on-rails-4

Ruby on Rails - Errno::EACCES in Posts#show


I'm doing this ruby on rails tutorial - http://guides.rubyonrails.org/getting_started.html After doing 6.4 part, I started getting this error if I try to do anything. For I get this error when trying to see a post:

Errno::EACCES in Posts#show

Showing /home/user/rails/blog/app/views/layouts/application.html.erb where line #5 raised:

 <html>
  <head>
    <title>Blog</title>
    <%= stylesheet_link_tag    "application", media: "all", "data-turbolinks-track" => true %>
    <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
    <%= csrf_meta_tags %>
  </head>

Permission denied - /home/user/rails/blog/tmp/cache/assets/development/sass/bd7e1cc0cf5d133ac313bf5ffa5e5d87b843522a/comments.css.scssc
  (in /home/user/rails/blog/app/assets/stylesheets/comments.css.scss)

Rails.root: /home/user/rails/blog

app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb__1904510075995834678_70186546148480'
Request

Parameters:

{"id"=>"1"}

It shows that this line raised an error:

<%= stylesheet_link_tag    "application", media: "all", "data-turbolinks-track" => true %>

And the file that shows I was denied to access (comments.css.scss), is empty, with just three comment lines. What could be wrong here? I followed tutorial guidelines, don't know what I could have done differently.


Solution

  • sudo chmod -R 777 /home/user/rails/blog will solve your problem.

    give it a try...