autoprefixer和指南针使用命令行

时间:2014-07-23 06:49:32

标签: autoprefixer

在我的项目中,我使用罗盘(只有好东西,没有网格和组件)+自举。

现在我决定添加:Autoprefixer with compass

第一步没问题。

  

gem install --http-proxy http://:8080 autoprefixer-rails

Successfully installed autoprefixer-rails-2.1.1.20140710
1 gem installed

之后我将这些行添加到config.rb的最后一行; 要求' autoprefixer-rails'

on_stylesheet_saved do |filename|
      css = File.read(filename)
      File.open(filename, 'w') do |io|
        io << AutoprefixerRails.process(css)
      end
end

这是编译结果:

>compass compile dev --trace
   create dev/../public/assets/css/main.css
ExecJS::ProgramError on line ["64"] of C: TypeError: Object doesn't support this property or method
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/execjs-2.2.1/lib/execjs/external_runtime.rb:29:in `exec'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/execjs-2.2.1/lib/execjs/external_runtime.rb:18:in `eval'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/execjs-2.2.1/lib/execjs/external_runtime.rb:36:in `call'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/autoprefixer-rails-2.1.1.20140710/lib/autoprefixer-rails/processor.rb:20:in `process'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/autoprefixer-rails-2.1.1.20140710/lib/autoprefixer-rails.rb:10:in `process'
  /dev/config.rb:24:in `block (2 levels) in get_binding'
  /dev/config.rb:23:in `open'
  /dev/config.rb:23:in `block in get_binding'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.19/lib/sass/callbacks.rb:60:in `[]'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.19/lib/sass/callbacks.rb:60:in `block in run_stylesheet_saved'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.19/lib/sass/callbacks.rb:60:in `each'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.19/lib/sass/callbacks.rb:60:in `run_stylesheet_saved'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.7/lib/compass/configuration/inheritance.rb:164:in `run_stylesheet_saved'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.7/lib/compass/configuration/inheritance.rb:166:in `run_stylesheet_saved'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.7/lib/compass/compiler.rb:144:in `compile'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.7/lib/compass/compiler.rb:118:in `compile_if_required'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.7/lib/compass/compiler.rb:103:in `block (2 levels) in run'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.7/lib/compass/compiler.rb:101:in `each'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.7/lib/compass/compiler.rb:101:in `block in run'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.7/lib/compass/compiler.rb:126:in `timed'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.7/lib/compass/compiler.rb:100:in `run'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.7/lib/compass/commands/update_project.rb:45:in `perform'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.7/lib/compass/commands/base.rb:18:in `execute'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.7/lib/compass/commands/project_base.rb:19:in `execute'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.7/lib/compass/exec/sub_command_ui.rb:43:in `perform!'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.7/lib/compass/exec/sub_command_ui.rb:15:in `run!'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.7/bin/compass:30:in `block in <top (required)>'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.7/bin/compass:44:in `call'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.7/bin/compass:44:in `<top (required)>'
  C:/Ruby193/bin/compass:23:in `load'
  C:/Ruby193/bin/compass:23:in `<main>'

我尝试像https://stackoverflow.com/a/14119187/1255274一样修改runtimes.rb,但仍然失败了。我无法在谷歌上找到任何帮助..有没有人知道会出现什么问题?

如果我一路走错路,任何人都可以向我推荐其他方法......

由于

0 个答案:

没有答案