简体   繁体   中英

Sass::SyntaxError: File to import not found or unreadable

I am using Rails 5 on my project and i am new on Rails. When i running

rake assets:precompile

I got error

Sass::SyntaxError: File to import not found or unreadable: mycustomize.

mycustomize.scss is my customize css file which is in /app/assets/stylesheets folder.

I searched a solution is change application.css to application.scss it do works, but i got a new error:

ActionController::RoutingError (No route matches [GET] “/stylesheets/application.css”) 

Anyone can explain and help on this. Thank you!

EDIT

application.html.erb

<head>
  <title>GoalStack</title>
  <p class="notice"><%= notice %></p>
  <p class="alert"><%= alert %></p>
  <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true %>
  <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
  <%= csrf_meta_tags %>
</head>

EDIT2 Before i add mycustomize.scss i use application.css which works well on server. I am trying to add some customize layout so i created mycustomize.scss and in application.css i add

@import "mycustomize";

After all of this all works well locally. When i try to deploy to my staging server, i got the error described above.

  config.public_file_server.enabled = false 

做到了,谢谢Arup Rakshit。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM