[英]Sass::SyntaxError: File to import not found or unreadable
I am using Rails 5 on my project and i am new on Rails. 我在项目中使用Rails 5,而我在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. mycustomize.scss是我的自定义css文件,位于
/app/assets/stylesheets
文件夹中。
I searched a solution is change application.css
to application.scss
it do works, but i got a new error: 我搜索了一个解决方案,就是将
application.css
更改为application.scss
它确实起作用,但是出现了新错误:
ActionController::RoutingError (No route matches [GET] “/stylesheets/application.css”)
Anyone can explain and help on this. 任何人都可以对此进行解释和帮助。 Thank you!
谢谢!
EDIT 编辑
application.html.erb 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. EDIT2在添加
mycustomize.scss
之前,我使用application.css
,它在服务器上运行良好。 I am trying to add some customize layout so i created mycustomize.scss
and in application.css i add 我试图添加一些自定义布局,所以我创建了
mycustomize.scss
并在application.css中添加了
@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。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.