尝试将应用推送到heroku时出错。
!
! Precompiling assets failed.
!
! Push rejected, failed to compile Ruby app
当我向上滚动时,我看到以下错误:
NoMethodError: undefined method `specificity' for [:not(.button)]:Array
(in /tmp/build_3060eff8-6b06-48b5-8d0d-51ce090945b4/app/assets/stylesheets/foundation_and_overrides.scss)
应用程序存在了很长一段时间,我上周更新了它,没有任何问题。 在这个推动中,我只有微小的变化。
我没有在foundation_and_overrides.scss中看到任何与'特异性'或:非(按钮)选择器有关的内容
在本地运行时:
rake assets:precompiled --trace
得到了同样的错误:
** Execute assets:precompile:primary
rake aborted!
NoMethodError: undefined method `specificity' for [:not(.button)]:Array
(in C:/Sites/..../app/assets/stylesheets/foundation_and_overrides.scss)
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sass-3.4.6/lib/sass/selector/abstract_sequence.rb:96:in `block in _specificity'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sass-3.4.6/lib/sass/selector/abstract_sequence.rb:94:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sass-3.4.6/lib/sass/selector/abstract_sequence.rb:94:in `_specificity'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sass-3.4.6/lib/sass/selector/abstract_sequence.rb:86:in `specificity'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sass-3.4.6/lib/sass/selector/abstract_sequence.rb:96:in `block in _specificity'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sass-3.4.6/lib/sass/selector/abstract_sequence.rb:94:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sass-3.4.6/lib/sass/selector/abstract_sequence.rb:94:in `_specificity'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sass-3.4.6/lib/sass/selector/abstract_sequence.rb:86:in `specificity'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sass-3.4.6/lib/sass/selector/sequence.rb:550:in `block (3 levels) in trim'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/set.rb:222:in `block in each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/set.rb:222:in `each_key'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/set.rb:222:in `each'
答案 0 :(得分:5)
@pazinjanka,你是生命的救星!我降级了,它再次像魅力一样工作。
要安装3.4.5,请使用命令sudo gem install sass -v 3.4.5
答案 1 :(得分:1)
您是否尝试在本地预编译它们?
RAILS_ENV=production bundle exec rake assets:precompile
也许你可以从错误中发布更多回溯?
你有没有更新你的宝石(Sass?),也许它可能与某些事情有关:https://github.com/sass/sass/issues/1476 不确定,只是猜测...答案 2 :(得分:0)
如果您已经安装了更高版本的sass。这样做:
将此添加到gemfile
<强>的Gemfile:强>
gem 'sass', '3.4.5'
然后运行bundle update sass