guard/guard-livereload

error: "hw.ncpu" is an unknown key

ilhyungl opened this issue · 4 comments

While running livereload through guard, I am getting the following errors:

12:23:49 - DEBUG - Command execution: hash stty
12:23:49 - DEBUG - Guard starts all plugins
12:23:49 - DEBUG - Hook :start_begin executed for Guard::Compass
12:23:49 - INFO - Guard::Compass is waiting to compile your stylesheets.
12:23:49 - DEBUG - Hook :start_end executed for Guard::Compass
12:23:49 - DEBUG - Hook :start_begin executed for Guard::LiveReload
RuntimeError: no acceptor (port is in use or requires root privileges) at /ruby/gems/gems/eventmachine-1.0.7/lib/eventmachine.rb:526:in `start_tcp_server'
[2015-03-16T12:23:49.939 DEBUG Guard::Ui(12511) #E19BB24975A2] Hook :start_end executed for Guard::LiveReload
error: "hw.ncpu" is an unknown key
12:23:50 - INFO - Guard is now watching at '/sites/al l/themes/hqbars_omega'
12:23:50 - DEBUG - Start interactor
[1] guard(main)> exit
12:24:14 - DEBUG - Interactor was stopped or killed
12:24:14 - DEBUG - Guard stops all plugins
12:24:14 - DEBUG - Hook :stop_begin executed for Guard::Compass
12:24:14 - DEBUG - Hook :stop_end executed for Guard::Compass
12:24:14 - DEBUG - Hook :stop_begin executed for Guard::LiveReload
12:24:14 - DEBUG - Hook :stop_end executed for Guard::LiveReload
12:24:14 - INFO - Bye bye...

This is trying to guard an omega theme on Drupal 7. I am running on redhat linux (hosted by BlueHost)..

Would greatly appreciate any help i can get.

Thanks!

e2 commented

@ilhyungl - Bluehost is probably not the right place to run Guard and Livereload - it's best to use it only to deploy finished applications - and not develop them there.

The hw.ncpu error is probably because the Redhat environment provided by Bluehost does not provide a standard way to detect the number of CPUs - https://github.com/celluloid/celluloid needs this (and Guard uses the Celluoid library through the Listen library).

You can set the number of threads/cpus manually with the NUMBER_OF_PROCESSORS variable, like this:

NUMBER_OF_PROCESSORS=4 bundle exec guard

https://github.com/celluloid/celluloid

Also, the livereload is failing because the port seems already used - see the docs for guard-livereload to see how to set a different port (if you even need livereload working).

@e2 - Thank you very much! Very much appreciate the advice and help.

e2 commented

You can also upgrade Listen to 3.x, which doesn't use Celluloid anymore.

(So there's no hw.ncpu problem).

e2 commented

The README on master is updated - thanks!