ruby-on-rails - 尝试部署到heroku时预编译资产失败
问题描述
我正在尝试使用终端命令将我的应用程序部署到 heroku git push heroku master
,但它在资产预编译期间失败,我无法理解错误消息。
我得到错误:
remote: I, [2019-09-07T14:40:57.856531 #1633] INFO -- : Writing /tmp/build_1e97b201914388013420d438aaf972eb/public/assets/application-6e5c569b523cb8b97f659b2b254c3a9c22a7cbd1d9c4f17afaf18019084c6544.js.gz
remote: rake aborted!
remote: SassC::SyntaxError: Error: Invalid CSS after "...e* bootstrap.*/": expected 1 selector or at-rule, was "*/"
remote: on line 14:76 of app/assets/stylesheets/application.scss
remote: >> t be set or imported *before* bootstrap.*/
remote:
remote: ------------------------------------------^
在 application.sccs 中,曾经有一行:
/* Custom bootstrap variables must be set or imported *before* bootstrap. */
@import "bootstrap";
@import "bootstrap/scss/bootstrap"
但是我已经删除了第一行,现在从第 14 行开始,我只有:
@import "bootstrap";
@import "bootstrap/scss/bootstrap"
但问题仍然存在。
解决方案
简单的错误可能是最难追踪的......
你只是少了一个分号......
@import "bootstrap";
@import "bootstrap/scss/bootstrap"; # <= that one
另请注意,您删除的行是 CSS 注释(介于 之间/* */
)
推荐阅读
- java - 使用 Apache Spark 更新一个巨大的文本文件
- android - Android:以低质量拍照
- javascript - 分配包含“id”的ajax html响应内容不能被触发?
- abap - 从 DB 中选择畅销书
- linux-from-scratch - 在 LFS 上对 libffi 的测试失败
- python-3.x - numPy 的高级索引如何用于布尔掩码?
- android - 齐射在同一个键上发送多个图像
- javascript - 无法设置未定义 4 的属性“大小”
- android - Rn 声音问题:在后台播放但在通话时停止音乐
- pandas - 如何从连续列值中提取最大和最小时间?