我在Ruby on Rails中有一个应用程序,我想将它部署到Heroku。当我使用时:
git push heroku master
我收到:
Running: rake assets:precompile
I, [2014-09-12T22:53:19.712552 #3977] INFO -- : Writing /tmp/build_8144ac61-2b4d-4c33-a84b-773d3ed45107/public/assets/application-aa652d65aa266c50abd3d3923088bd7b.js
Warning. Error encountered while saving cache 54dea0949cb8162db200869afc1e3ec3e59aa6f5/application.css.scssc: can't dump anonymous class #<Class:0x007f69378b55e0>
Warning. Error encountered while saving cache 6494cddcc41216a13b0133cf1ff1a38d862cca7d/bootstrap.cssc: can't dump anonymous class #<Class:0x007f69378b55e0>
I, [2014-09-12T22:53:21.996810 #3977] INFO -- : Writing /tmp/build_8144ac61-2b4d-4c33-a84b-773d3ed45107/public/assets/application-1fa80de3f5da7b963874482caa63bdec.css
I, [2014-09-12T22:53:22.003454 #3977] INFO -- : Writing /tmp/build_8144ac61-2b4d-4c33-a84b-773d3ed45107/public/assets/bootstrap/glyphicons-halflings-regular-f1da5588b59d269c3dc4cb4cace31400.eot
I, [2014-09-12T22:53:22.005586 #3977] INFO -- : Writing /tmp/build_8144ac61-2b4d-4c33-a84b-773d3ed45107/public/assets/bootstrap/glyphicons-halflings-regular-6f65445249d6bb87a786a1a13a0a45a6.svg
I, [2014-09-12T22:53:22.007571 #3977] INFO -- : Writing /tmp/build_8144ac61-2b4d-4c33-a84b-773d3ed45107/public/assets/bootstrap/glyphicons-halflings-regular-35f432c4b92a1a110edde9f76e6e5ce7.ttf
I, [2014-09-12T22:53:22.009543 #3977] INFO -- : Writing /tmp/build_8144ac61-2b4d-4c33-a84b-773d3ed45107/public/assets/bootstrap/glyphicons-halflings-regular-9c39baa8409ae5776b4dcfa54a685bf8.woff
I, [2014-09-12T22:53:22.134260 #3977] INFO -- : Writing /tmp/build_8144ac61-2b4d-4c33-a84b-773d3ed45107/public/assets/bootstrap/affix-92368f20b1e758f02b5ca11f872a7752.js
I, [2014-09-12T22:53:22.220282 #3977] INFO -- : Writing /tmp/build_8144ac61-2b4d-4c33-a84b-773d3ed45107/public/assets/bootstrap/alert-c2357af988be9ad011c1f3ba46beaddb.js
I, [2014-09-12T22:53:22.310256 #3977] INFO -- : Writing /tmp/build_8144ac61-2b4d-4c33-a84b-773d3ed45107/public/assets/bootstrap/button-17cac2dc446e444848863bfc4776e852.js
I, [2014-09-12T22:53:22.647225 #3977] INFO -- : Writing /tmp/build_8144ac61-2b4d-4c33-a84b-773d3ed45107/public/assets/bootstrap/carousel-e9b647222f7dd671b4565bd842afa643.js
I, [2014-09-12T22:53:22.768327 #3977] INFO -- : Writing /tmp/build_8144ac61-2b4d-4c33-a84b-773d3ed45107/public/assets/bootstrap/collapse-810e66df78dde2cc207c63ef17d5c2e8.js
I, [2014-09-12T22:53:22.870856 #3977] INFO -- : Writing /tmp/build_8144ac61-2b4d-4c33-a84b-773d3ed45107/public/assets/bootstrap/dropdown-8413f8357355cb6669b65ec46750e200.js
I, [2014-09-12T22:53:23.052750 #3977] INFO -- : Writing /tmp/build_8144ac61-2b4d-4c33-a84b-773d3ed45107/public/assets/bootstrap/modal-7be05ab2cc23ccf7ad1be26c81be1416.js
I, [2014-09-12T22:53:23.149494 #3977] INFO -- : Writing /tmp/build_8144ac61-2b4d-4c33-a84b-773d3ed45107/public/assets/bootstrap/popover-0d1a5c674a16da1bb5426410a9eed66b.js
I, [2014-09-12T22:53:23.650615 #3977] INFO -- : Writing /tmp/build_8144ac61-2b4d-4c33-a84b-773d3ed45107/public/assets/bootstrap/scrollspy-ceecc136ebf2d51fc366ccbe558ea772.js
I, [2014-09-12T22:53:23.710636 #3977] INFO -- : Writing /tmp/build_8144ac61-2b4d-4c33-a84b-773d3ed45107/public/assets/bootstrap/tab-1b0a1bca02063c2bca12e6199ae06988.js
I, [2014-09-12T22:53:24.147128 #3977] INFO -- : Writing /tmp/build_8144ac61-2b4d-4c33-a84b-773d3ed45107/public/assets/bootstrap/tooltip-71bda573b0a8c849e2ca2220b5764303.js
I, [2014-09-12T22:53:24.199479 #3977] INFO -- : Writing /tmp/build_8144ac61-2b4d-4c33-a84b-773d3ed45107/public/assets/bootstrap/transition-61115fa95fb6e75a229bc2ae598f5e1c.js
Warning. Error encountered while saving cache 225fb679bd2b2336b68e1237ebb4440fe415f4b0/_alerts.scssc: can't dump anonymous class #<Class:0x007f69378b55e0>
rake aborted!
Sass::SyntaxError: Undefined variable: "$alert-padding".
我使用Boostrap。在 app / assets / stylesheets.css.scss 中,我有:
@import&#34; bootstrap&#34;;
和 vendor / assets / stylesheets 我有bootstrap.css和bootstrap.min.css
在我的 production.rb 中,其中包括:
config.serve_static_assets = true
config.assets.compile = true
config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
config.cache_store = :dalli_store
config.assets.precompile += %w( bootstrap/*.css bootstrap/*.js )
我显然使用rake资产:预编译,那么它有什么问题?
答案 0 :(得分:0)
确保您在Gemfile中使用bootstrap-sass gem
gem 'bootstrap-sass'
编辑:另外根据这里的另一个帖子,显然包含连字符的文件可能存在问题。尝试删除连字符。
答案 1 :(得分:0)
你有没有尝试降级你的宝石?
试试这个:
gem "sass", "~> 3.2.5"
gem 'sass-rails'
答案 2 :(得分:-1)
Sass查找正确的语法请检查您的css文件,如果有任何“空格”删除它