rails 4 scss lint因sass rails而失败

时间:2014-08-05 06:11:52

标签: ruby-on-rails ruby sass

当我尝试scint lint scss-lint app/assets/stylesheets/**/*.css.scss时,我收到以下错误:

/Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/sass-3.2.19/lib/sass/tree/media_node.rb:38:in `value': NotImplementedError (NotImplementedError)
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/scss-lint-0.7.0/lib/sass/tree.rb:55:in `children'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/sass-3.2.19/lib/sass/tree/visitors/base.rb:53:in `visit_children'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/sass-3.2.19/lib/sass/tree/visitors/base.rb:37:in `block in visit'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/sass-3.2.19/lib/sass/tree/visitors/set_options.rb:113:in `visit_media'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/sass-3.2.19/lib/sass/tree/visitors/base.rb:37:in `visit'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/sass-3.2.19/lib/sass/tree/visitors/set_options.rb:15:in `visit'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/sass-3.2.19/lib/sass/tree/visitors/base.rb:53:in `block in visit_children'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/sass-3.2.19/lib/sass/tree/visitors/base.rb:53:in `map'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/sass-3.2.19/lib/sass/tree/visitors/base.rb:53:in `visit_children'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/sass-3.2.19/lib/sass/tree/visitors/base.rb:37:in `block in visit'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/sass-3.2.19/lib/sass/tree/visitors/set_options.rb:66:in `visit_mixindef'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/sass-3.2.19/lib/sass/tree/visitors/base.rb:37:in `visit'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/sass-3.2.19/lib/sass/tree/visitors/set_options.rb:15:in `visit'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/sass-3.2.19/lib/sass/tree/visitors/base.rb:53:in `block in visit_children'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/sass-3.2.19/lib/sass/tree/visitors/base.rb:53:in `map'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/sass-3.2.19/lib/sass/tree/visitors/base.rb:53:in `visit_children'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/sass-3.2.19/lib/sass/tree/visitors/base.rb:39:in `visit'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/sass-3.2.19/lib/sass/tree/visitors/set_options.rb:15:in `visit'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/sass-3.2.19/lib/sass/tree/visitors/set_options.rb:5:in `visit'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/sass-3.2.19/lib/sass/tree/node.rb:69:in `options='
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/sass-3.2.19/lib/sass/engine.rb:348:in `_to_tree'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/sass-3.2.19/lib/sass/engine.rb:274:in `to_tree'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/scss-lint-0.7.0/lib/scss_lint/engine.rb:20:in `initialize'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/scss-lint-0.7.0/lib/scss_lint/runner.rb:38:in `new'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/scss-lint-0.7.0/lib/scss_lint/runner.rb:38:in `find_lints'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/scss-lint-0.7.0/lib/scss_lint/runner.rb:29:in `block in run'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/scss-lint-0.7.0/lib/scss_lint/runner.rb:28:in `each'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/scss-lint-0.7.0/lib/scss_lint/runner.rb:28:in `run'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/scss-lint-0.7.0/lib/scss_lint/cli.rb:55:in `run'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/scss-lint-0.7.0/bin/scss-lint:7:in `block in <top (required)>'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/scss-lint-0.7.0/bin/scss-lint:5:in `tap'
    from /Users/chrishough/BusinessHuedio/CodeHuedio/SocialPlatform/.bundle/ruby/2.1.0/gems/scss-lint-0.7.0/bin/scss-lint:5:in `<top (required)>'
    from .bundle/binstubs/scss-lint:16:in `load'
    from .bundle/binstubs/scss-lint:16:in `<main>'

我已按照此处https://github.com/causes/scss-lint/issues/53的说明操作,然后从gemfile中删除scss-lint并运行以下内容:

bundle clean 
gem install sass
gem install scss-lint

现在我尝试运行scss-lint app/assets/stylesheets/**/*.css.scss并获得以下内容:

scss-lint app/assets/stylesheets/**/*.css.scss
/Users/chrishough/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.5.3/lib/bundler/rubygems_integration.rb:293:in `block in replace_bin_path': can't find executable scss-lint (Gem::Exception)
    from .bundle/binstubs/scss-lint:16:in `<main>'
  

这可能是我的路径吗?

当我运行echo $PATH时,我得到以下内容:

.bundle/binstubs /Users/chrishough/.rbenv/shims .bundle/binstubs /usr/local/bin /usr/bin /bin /usr/sbin /sbin /opt/local/bin /usr/local/share/npm/bin

现在我迷路了....

有人对这种无限循环有什么想法吗?

1 个答案:

答案 0 :(得分:-1)

我必须rm -rf .bundle并重新安装bundle install --path=.bundle --binstubs=.bundle/binstubs

奇怪,这个修好了!