PXF_LY's Blog

2017年03月06号Bug2

上传heroku报错:

rake aborted!
remote: Sass::SyntaxError: Invalid CSS after "...sition: 0.5s; }": expected "}", was ""
remote: (sass):10433

remote: Tasks: TOP => assets:precompile
remote: (See full trace by running task with --trace)
remote: !
remote: ! Precompiling assets failed.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to guarded-dusk-10461.

第二次解决办法

1-根据这个 You can check the syntax of your files by running sass -c app/assets/stylesheets. That might detect the issue for you.

You can also specify wildcards like

2-也可以http://www.sassmeister.com/gist/858d3b3bf9ec2a95dccfaa11d830b701 用这个网址检查,把提示的少“{”加上

3-或者根据报错提示
Invalid CSS after "...rial,sans-serif": expected "{", was ";font-size:100%…”

搜索font-size:100%,手动改:

然后直接上传heroku。
还是报错:

rake aborted!
remote: Sass::SyntaxError: Invalid CSS after "...sition: 0.5s; }": expected "}", was ""
remote: (sass):10433

尝试3:

  1. 删掉1a—266那个文件
    直接 git push heroku story8:master

  2. 还是报错
    rake aborted!
    remote: Sass::SyntaxError: Invalid CSS after "...sition: 0.5s; }": expected "}", was ""
    remote: (sass):10433

  1. assets/stylesheets确实不用重启rails s
  2. 应该直接上传没有影响

尝试4

在刚才删掉了那个文件的基础上
rake assets:precompile
git add .
git commit -m"Add precompiled assets for Heroku"
git push heroku story8:master

尝试5

  1. 在原网页上,找到删除的文件
  2. 放回到atom中,
  3. 复制他只有一行的代码,到 http://www.sassmeister.com/gist/858d3b3bf9ec2a95dccfaa11d830b701sass变成css)(从
  4. 复制转换好的代码,替换掉那一行代码

  1. 保存
  2. rake assets:precompile git add . git commit -m"Add precompiled assets for Heroku"
  3. git push heroku story8:master

http://forum.qzy.camp/t/heroku/471

上传成功后,还要跑资料库,在terminal中打开,否则会:

总结:

  1. http://www.sassmeister.com/gist/858d3b3bf9ec2a95dccfaa11d830b701sass变成css)(从
  2. http://forum.qzy.camp/t/heroku/471