Closed
Description
After upgrading to Jekyll 2.0.2 from 1.5.1, I met this issue while building my repository using jekyll serve --trace
.
Environment:
- Linux Mint 16, Ruby 2.1.1p76, Jekyll gem 2.0.2
Stacktrace:
/home/yze14/.rvm/gems/ruby-2.1.1/gems/execjs-2.0.2/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /home/yze14/.rvm/gems/ruby-2.1.1/gems/execjs-2.0.2/lib/execjs.rb:5:in `<module:ExecJS>'
from /home/yze14/.rvm/gems/ruby-2.1.1/gems/execjs-2.0.2/lib/execjs.rb:4:in `<top (required)>'
from /home/yze14/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /home/yze14/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /home/yze14/.rvm/gems/ruby-2.1.1/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `<top (required)>'
from /home/yze14/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /home/yze14/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /home/yze14/.rvm/gems/ruby-2.1.1/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `<top (required)>'
from /home/yze14/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /home/yze14/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /home/yze14/.rvm/gems/ruby-2.1.1/gems/jekyll-coffeescript-1.0.0/lib/jekyll-coffeescript.rb:2:in `<top (required)>'
from /home/yze14/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /home/yze14/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /home/yze14/.rvm/gems/ruby-2.1.1/gems/jekyll-2.0.2/lib/jekyll.rb:73:in `<top (required)>'
from /home/yze14/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /home/yze14/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /home/yze14/.rvm/gems/ruby-2.1.1/gems/jekyll-2.0.2/bin/jekyll:6:in `<top (required)>'
from /home/yze14/.rvm/gems/ruby-2.1.1/bin/jekyll:23:in `load'
from /home/yze14/.rvm/gems/ruby-2.1.1/bin/jekyll:23:in `<main>'
from /home/yze14/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
from /home/yze14/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
A little bit Googling told me it had something to do with Node.js. sudo apt-get install nodejs
fixes it. I'm wondering if this is something should be handled by Jekyll installation or not (at least we might want to document it somewhere maybe?)
Activity
mscharley commentedon May 7, 2014
Installing system packages isn't something jekyll should be doing. I'm more
curious what part of jekyll actually uses node as this isn't something I've
heard of before.
On 7 May 2014 21:56, Yi Zeng notifications@github.com wrote:
davidcelis commentedon May 7, 2014
The CoffeeScript gem depends on execjs which itself requires a JavaScript runtime. Node.js does fulfill this requirement, but you also could have bundled a gem called
therubyracer
. This probably should be documented in jekyll/jekyll-coffeescriptNote requirement of JavaScript runtime
parkr commentedon May 7, 2014
Maybe we should make jekyll-coffeescript optional?
davidcelis commentedon May 7, 2014
Maybe? I personally don't care about using CoffeeScript, but I guess I also don't care too much about the added dependency. I'm indifferent, though others in my shoes may prefer it to be an optional plugin. Although, that big 2.0.0 blog post did have a pretty big "Native Sass & CoffeeScript support" bullet point... 😉
prayerslayer commentedon May 8, 2014
I'm not using CoffeeScript either, but I host a Jekyll-generated blog on my VPS. I want to keep the machine as clean as possible and refuse therefore to install Node globally as long as I don't need it. A Ruby-based blogging engine happening to have a transitive dependency on a JS runtime does not count as "needing" for me :)
I would propose to either remove dependencies on non-Ruby things altogether or to include workarounds (such as
therubyracer
) by default. Maybe I'm in a minority there, but expect software written in Ruby to work in a Ruby-only environment.Thank you very much for your effort by the way <3
mscharley commentedon May 8, 2014
Agreed, and there's been conversation elsewhere in the issue queue about
this if you want to look for it.. I believe the consensus at the moment is
that the coffeescript plugin won't be a prerequisite of jekyll core going
forward.
On 9 May 2014 07:57, Nikolaus Piccolotto notifications@github.com wrote:
benbalter commentedon May 9, 2014
I'd really hate to add yet-another-config-option, especially when intent can be discerned very easily from filenames. Perhaps we could lazy-load coffeescript and sass if the generator discovers a
.coffee
or.sass
file with YAML frontmatter?parkr commentedon May 9, 2014
What config option would we have to add? The proposed solution (#2362) simply loads the gems if they're there, and ignores them if not.
benbalter commentedon May 9, 2014
You'd have to add it to the Gemfile though, right? The above error looks like it occurs when required, not when bundled, right?
mscharley commentedon May 9, 2014
It's an error on require, yes.
On 10 May 2014 00:36, Ben Balter notifications@github.com wrote:
parkr commentedon May 9, 2014
It's required all the time. 😦 My solution illustrates this in the red. :)
mchelen commentedon May 21, 2014
Confirming bug after a fresh install of Jekyll 2.0.3 on a clean Ubuntu 14.04 system with Ruby 1.9.3.4.
After installation, trying to run Jekyll on an existing website repository showed the above ExecJS error. Installing either
nodejs
ortherubyracer
fixed the problem.42 remaining items