Skip to content

Could not find a JavaScript runtime. (ExecJS::RuntimeUnavailable) #2327

Closed
@yizeng

Description

@yizeng

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

mscharley commented on May 7, 2014

@mscharley
Contributor

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:

After upgrading to Jekyll 2.0.2 from 1.5.1, I met this issue while
building my repository https://github.com/yizeng/yizeng.me 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:inmodule: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:inrequire'
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:inrequire'
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:inrequire'
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:inrequire'
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:inrequire'
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

'
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'

A little bit Googling told me it has 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 at least document it somewhere?


Reply to this email directly or view it on GitHubhttps://github.com//issues/2327
.

davidcelis

davidcelis commented on May 7, 2014

@davidcelis
Contributor

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-coffeescript

parkr

parkr commented on May 7, 2014

@parkr
Member

Maybe we should make jekyll-coffeescript optional?

davidcelis

davidcelis commented on May 7, 2014

@davidcelis
Contributor

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

prayerslayer commented on May 8, 2014

@prayerslayer

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

mscharley commented on May 8, 2014

@mscharley
Contributor

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:

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 things written in Ruby to work in
a Ruby-only environment.

Thank you very much for your effort by the way <3


Reply to this email directly or view it on GitHubhttps://github.com//issues/2327#issuecomment-42611468
.

benbalter

benbalter commented on May 9, 2014

@benbalter
Contributor

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

parkr commented on May 9, 2014

@parkr
Member

I'd really hate to add yet-another-config-option

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

benbalter commented on May 9, 2014

@benbalter
Contributor

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

mscharley commented on May 9, 2014

@mscharley
Contributor

It's an error on require, yes.

On 10 May 2014 00:36, Ben Balter notifications@github.com wrote:

You'd have to add it to the Gemfile though, right? The above error looks
like it occurs when required, not when bundled, right?


Reply to this email directly or view it on GitHubhttps://github.com//issues/2327#issuecomment-42672826
.

parkr

parkr commented on May 9, 2014

@parkr
Member

It's an error on require, yes.

It's required all the time. 😦 My solution illustrates this in the red. :)

mchelen

mchelen commented on May 21, 2014

@mchelen

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 or therubyracer fixed the problem.

42 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Could not find a JavaScript runtime. (ExecJS::RuntimeUnavailable) · Issue #2327 · jekyll/jekyll