Sass :: SyntaxError:无效的CSS后“位置:“:预期表达式(例如1px,粗体) [英] Sass::SyntaxError: Invalid CSS after " position: ": expected expression (e.g. 1px, bold)

查看:1348
本文介绍了Sass :: SyntaxError:无效的CSS后“位置:“:预期表达式(例如1px,粗体)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


rake aborted!

rake aborted!

Sass :: SyntaxError:position:后的无效CSS:预期表达式(例如1px,粗体),是;

Sass::SyntaxError: Invalid CSS after " position: ": expected expression (e.g. 1px, bold), was ";"

(位于F:/OrderBooking/app/assets/stylesheets/application.css)
(sass):340

(in F:/OrderBooking/app/assets/stylesheets/application.css) (sass):340

任务:TOP =>资产:预编译

Tasks: TOP => assets:precompile

在我的本地机器中没有错误,但在部署我的应用程序时,我收到了上述错误。但在我的 application.css 中我什么都没有。

In my local machine there is no error, but while deploying my application, I am getting the above error. But in my application.css i have nothing in it.

推荐答案

CSS中的语法错误在开发环境中被忽略,但在生产环境中,在预编译资产时会出现这些错误。所以为了确保你的CSS没有语法错误,每次上传到生产前,运行下面的命令,如果它运行成功,罚款,如果它抛出错误,然后修复语法错误,以下是命令:

Syntax errors in CSS are ignored in development environment, but in production environment while precompiling assets these errors come. So to make sure your CSS has no syntax errors, every time before uploading to production, run the following command, fine if it runs successfully, if it throws error then fix the syntax error, following is the command

RAILS_ENV=development rake assets:precompile

在你的情况中,错误说在你的 application.css.scss 中,行号 340 ,有一个语法错误。因此,您需要修复语法错误并将代码再次推送至Heroku

In your case, the error says, In your application.css.scss, in line number 340, there's a syntax error. So you need to fix the syntax error and push the codes again to Heroku.

希望这有助于您!

这篇关于Sass :: SyntaxError:无效的CSS后“位置:“:预期表达式(例如1px,粗体)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆