scottnix / scottnix2014

New Personal Theme
3 stars 0 forks source link

Autoprefixer not working with Compass #1

Open scottnix opened 10 years ago

scottnix commented 10 years ago

Can't really find information on why it isn't working. Super simple setup, not much info out there on others with similar issues. This information is just for me to reference so I don't have to go through the process of reproducing the error to get more information.

config.rb

require 'autoprefixer-rails'

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

compass watch (error without trace)

ExecJS::ProgramError on line ["68"] of C: TypeError: Object doesn't support this property or method

compass watch --trace

ExecJS::ProgramError on line ["68"] of C: TypeError: Object doesn't support this property or method
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/execjs-2.0.2/lib/execjs/external_runtime.rb:28:in `block in exec'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/execjs-2.0.2/lib/execjs/external_runtime.rb:41:in `compile_to_tempfile'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/execjs-2.0.2/lib/execjs/external_runtime.rb:27:in `exec'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/execjs-2.0.2/lib/execjs/external_runtime.rb:19:in `eval'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/execjs-2.0.2/lib/execjs/external_runtime.rb:33:in `call'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/autoprefixer-rails-1.1.20140327/lib/autoprefixer-rails/processor.rb:20:in `p
rocess'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/autoprefixer-rails-1.1.20140327/lib/autoprefixer-rails.rb:10:in `process'
  C:/xampp/htdocs/githubs/wp-content/themes/scottnix2014/config.rb:25:in `block (2 levels) in get_binding'
  C:/xampp/htdocs/githubs/wp-content/themes/scottnix2014/config.rb:24:in `open'
  C:/xampp/htdocs/githubs/wp-content/themes/scottnix2014/config.rb:24:in `block in get_binding'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.3.4/lib/sass/callbacks.rb:61:in `[]'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.3.4/lib/sass/callbacks.rb:61:in `block in run_stylesheet_saved'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.3.4/lib/sass/callbacks.rb:61:in `each'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.3.4/lib/sass/callbacks.rb:61:in `run_stylesheet_saved'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-core-1.0.0.alpha.19/lib/compass/configuration/inheritance.rb:167:in
`run_stylesheet_saved'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-core-1.0.0.alpha.19/lib/compass/configuration/inheritance.rb:169:in
`run_stylesheet_saved'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-1.0.0.alpha.19/lib/compass/compiler.rb:177:in `compile'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-1.0.0.alpha.19/lib/compass/compiler.rb:144:in `compile_if_required'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-1.0.0.alpha.19/lib/compass/compiler.rb:129:in `block (2 levels) in r
un'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-1.0.0.alpha.19/lib/compass/compiler.rb:127:in `each'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-1.0.0.alpha.19/lib/compass/compiler.rb:127:in `block in run'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-1.0.0.alpha.19/lib/compass/compiler.rb:153:in `timed'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-1.0.0.alpha.19/lib/compass/compiler.rb:126:in `run'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-1.0.0.alpha.19/lib/compass/watcher/compiler.rb:24:in `compile'
  C:/Ruby193/lib/ruby/1.9.1/forwardable.rb:201:in `compile'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-1.0.0.alpha.19/lib/compass/watcher/project_watcher.rb:101:in `sass_m
odified'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-1.0.0.alpha.19/lib/compass/watcher/project_watcher.rb:89:in `sass_ca
llback'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-1.0.0.alpha.19/lib/compass/watcher/watch.rb:14:in `call'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-1.0.0.alpha.19/lib/compass/watcher/watch.rb:14:in `run_callback'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-1.0.0.alpha.19/lib/compass/watcher/project_watcher.rb:69:in `block i
n listen_callback'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-1.0.0.alpha.19/lib/compass/watcher/project_watcher.rb:66:in `each'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-1.0.0.alpha.19/lib/compass/watcher/project_watcher.rb:66:in `listen_
callback'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.1.6/lib/listen/listener.rb:236:in `call'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.1.6/lib/listen/listener.rb:236:in `on_change'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.1.6/lib/listen/listener.rb:271:in `block in initialize_adapter'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.1.6/lib/listen/adapter.rb:244:in `call'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.1.6/lib/listen/adapter.rb:244:in `report_changes'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.1.6/lib/listen/adapter.rb:313:in `poll_changed_directories'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.1.6/lib/listen/adapter.rb:289:in `block in start_poller'

gem query --local

autoprefixer-rails (1.1.20140327)
bigdecimal (1.1.0)
celluloid (0.15.2)
chunky_png (1.3.0, 1.2.9)
compass (1.0.0.alpha.19, 0.12.4, 0.12.2)
compass-core (1.0.0.alpha.19)
compass-import-once (1.0.4)
csso-rails (0.3.4)
execjs (2.0.2)
ffi (1.9.3 x86-mingw32)
fssm (0.2.10)
io-console (0.3)
json (1.8.1, 1.5.5)
listen (1.1.6)
minitest (5.3.1, 2.5.1)
multi_json (1.9.2)
rake (10.2.1, 0.9.2.2)
rb-fsevent (0.9.4)
rb-inotify (0.9.3)
rb-kqueue (0.2.2)
rdoc (4.1.1, 3.9.5)
sass (3.3.4, 3.2.18, 3.2.12)
susy (2.1.1, 1.0.9)
timers (1.1.0)
wdm (0.1.0)
ghost commented 10 years ago

Hiya, Did you ever manage to find out what the issue was? I am having the same drama. Super keen to get it to work.

scottnix commented 10 years ago

I couldn't find any information, Pretty sure I gave up trying to fix it after a few hours, but I was still hell-bent on using Autoprefixer.

I actually ended up switching my workflow to incorporate http://gulpjs.com/ which Autoprefixer worked in with no issues, not to mention gulp provided a ton of other benefits. So if you have a little free time, I highly recommend using gulp as a build system.

If you go that route, check out http://markgoodyear.com/2014/01/getting-started-with-gulp/ which made it pretty easy to setup.

If you are trying to get this setup for WordPress related projects, this is a very simple gulpfile.js I use https://github.com/scottnix/responsive-base-plus/blob/master/gulpfile.js which might help as a reference which uses Autoprefixer, Livereload, Sass. The gems Susy and Compass are also in there too, but require an addtional step of using @import 'susy'; in the actual Sass files.