SyntaxError:在“位置”之后,无效的CSS:期望的表达式(如1px,粗体)

时间:2021-01-09 22:48:29

rake aborted!

rake流产!

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

SyntaxError:在“位置”之后,无效的CSS:期望表达式(如1px,粗体),是“;”

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

(在F:/发货簿/ app /资产/样式表/ application.css)(sass):340

Tasks: TOP => assets:precompile

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

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我什么都没有。

2 个解决方案

#1


5  

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

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

RAILS_ENV=development rake assets:precompile

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.

在你的例子中,错误说,在你的应用。css。scss,在第340行,有一个语法错误。因此,您需要修复语法错误并将代码再次推给Heroku。

Hope this helps!

希望这可以帮助!

#2


0  

I got this one time because I was trying to use <script src=" on CSS on my index.html file instead of <link rel="stylesheet" href=

我有一次是因为我想用

#1


5  

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

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

RAILS_ENV=development rake assets:precompile

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.

在你的例子中,错误说,在你的应用。css。scss,在第340行,有一个语法错误。因此,您需要修复语法错误并将代码再次推给Heroku。

Hope this helps!

希望这可以帮助!

#2


0  

I got this one time because I was trying to use <script src=" on CSS on my index.html file instead of <link rel="stylesheet" href=

我有一次是因为我想用