I have a Rails 4 application installed on RHEL 6 machine.
The production uses Passenger and Apache2.
Lately I've been trying to integrate Rake tasks into production as a scheduled job using Whenever Gem and Cron.
Whenever I try to run in production one of these Rake tasks, I get the following error:
rake aborted!
ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.
It is important to mention the NodeJS was installed on the machine. I can precompile assets, and so on.
Specifically, the command node --version
produces: v0.10.31
Here's my stack trace:
rake aborted!
ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.
/var/www/eng_performance/shared/bundle/ruby/2.0.0/gems/execjs-2.2.1/lib/execjs/runtimes.rb:51:in `autodetect'
/var/www/eng_performance/shared/bundle/ruby/2.0.0/gems/execjs-2.2.1/lib/execjs.rb:5:in `<module:ExecJS>'
/var/www/eng_performance/shared/bundle/ruby/2.0.0/gems/execjs-2.2.1/lib/execjs.rb:4:in `<top (required)>'
/var/www/eng_performance/shared/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `require'
/var/www/eng_performance/shared/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `block in require'
/var/www/eng_performance/shared/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:214:in `load_dependency'
/var/www/eng_performance/shared/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `require'
/var/www/eng_performance/shared/bundle/ruby/2.0.0/gems/uglifier-2.5.3/lib/uglifier.rb:3:in `<top (required)>'
/home/deploy/.rvm/gems/ruby-2.0.0-p481/gems/bundler-1.7.2/lib/bundler/runtime.rb:76:in `require'
/home/deploy/.rvm/gems/ruby-2.0.0-p481/gems/bundler-1.7.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
/home/deploy/.rvm/gems/ruby-2.0.0-p481/gems/bundler-1.7.2/lib/bundler/runtime.rb:72:in `each'
/home/deploy/.rvm/gems/ruby-2.0.0-p481/gems/bundler-1.7.2/lib/bundler/runtime.rb:72:in `block in require'
/home/deploy/.rvm/gems/ruby-2.0.0-p481/gems/bundler-1.7.2/lib/bundler/runtime.rb:61:in `each'
/home/deploy/.rvm/gems/ruby-2.0.0-p481/gems/bundler-1.7.2/lib/bundler/runtime.rb:61:in `require'
/home/deploy/.rvm/gems/ruby-2.0.0-p481/gems/bundler-1.7.2/lib/bundler.rb:133:in `require'
/var/www/eng_performance/releases/20141014084554/config/application.rb:7:in `<top (required)>'
/var/www/eng_performance/releases/20141014084554/Rakefile:4:in `require'
/var/www/eng_performance/releases/20141014084554/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
Note: I've installed NodeJS as a compilation from source, because when I tried to install from the repo I got this error that I didn't know how to overcome:
Packages skipped because of dependency problems:
c-ares19-1.9.1-5.el6.3.x86_64 from epel
http-parser-2.0-4.20121128gitcd01361.el6.x86_64 from epel
1:libuv-0.10.28-1.el6.x86_64 from epel
nodejs-0.10.30-1.el6.x86_64 from epel
1:v8-3.14.5.10-11.el6.x86_64 from epel