我有一个我试图用mina部署的rails 4应用程序。当我运行mina deploy
时,它在资产预编译步骤中失败并以状态19退出。这是它正在吐出的错误:
rake aborted!
Invalid CSS after " *": expected "{", was "= require found..."
(in /var/www/someapp/tmp/build-139204594512190/app/assets/stylesheets/application.css)
(sass):15
所以我可以清楚地看到css文件和尝试预编译它可能有问题。在我尝试修复问题之前,我想确保文件出现问题,因此我运行了rake assets:precompile
。瞧,没有错误,一切顺利。我想也许这是dev配置与生产相比之间的区别所以我备份了我的development.rb文件,复制了production.rb并将其重命名为development.rb并再次尝试并且它有效。因此,如果我从rake运行命令,它可以工作,但如果mina在部署期间尝试该命令则失败。
我真的不知道如何处理这个问题。下面是application.css文件,给出错误的行是*= require foundation_and_overrides
/* * This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require_self
*= require_tree .
*/
*= require foundation_and_overrides
@font-face {
font-family: 'relay-medium';
src: url('<%= asset_path("relay-medium.ttf") %>');
font-weight: normal;
font-style: normal;
}
感谢您的帮助!
答案 0 :(得分:0)
通过将最后一个*= require foundation_and_overrides
移动到注释块中来解决问题。