electric-it / minimart

MiniMart RubyGem for Chef cookbook mirroring and storage.
Apache License 2.0
52 stars 20 forks source link

(ExecJS::RuntimeUnavailable) #49

Closed chrisgit closed 8 years ago

chrisgit commented 8 years ago

Hello,

When running the "minimart mirror" command after installing minimart Gem version 1.2.3 I get the following error

[vagrant@centos minimart]$ minimart mirror
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in `autodetect': Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
        from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/execjs-2.7.0/lib/execjs.rb:5:in `<module:ExecJS>'
        from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/execjs-2.7.0/lib/execjs.rb:4:in `<top (required)>'
        from /opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/uglifier-3.0.0/lib/uglifier.rb:5:in `<top (required)>'
        from /opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/minimart-1.2.3/lib/minimart/web/html_generator.rb:3:in `<top (required)>'
        from /opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/minimart-1.2.3/lib/minimart/web.rb:6:in `<module:Web>'
        from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/minimart-1.2.3/lib/minimart/web.rb:4:in `<module:Minimart>'
        from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/minimart-1.2.3/lib/minimart/web.rb:1:in `<top (required)>'
        from /opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/minimart-1.2.3/lib/minimart.rb:10:in `<module:Minimart>'
        from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/minimart-1.2.3/lib/minimart.rb:4:in `<top (required)>'
        from /opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:68:in `require'
        from /opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:68:in `require'
        from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/minimart-1.2.3/lib/minimart/cli.rb:3:in `<top (required)>'
        from /opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:68:in `require'
        from /opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:68:in `require'
        from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/minimart-1.2.3/bin/minimart:3:in `<top (required)>'
        from /opt/chef/embedded/bin/minimart:22:in `load'
        from /opt/chef/embedded/bin/minimart:22:in `<main>'
[vagrant@centos minimart]$

The O/S is CentOS 6.7 Ruby version ruby 2.1.8p440 (2015-12-16 revision 53160) [x86_64-linux](supplied with Chef)

Are we missing a Gem or need a specific version of Ruby?

If I roll back to Minimart 1.2.0 I get the following error

ERROR:  Error installing minimart:   minimart requires Ruby version ~> 2.1, ~> 2.2.

Which is what I think Minimart 1.2.3 fixes https://github.com/electric-it/minimart/issues/47

We are currently using minimart version 1.1.3 but often have pain installing the dep-selector-libgecode gem as it takes a long time building native extensions, the later versions of Minimart do not appear to need this Gem, is that correct?

Thanks in advance.

tapickell commented 8 years ago

Install NodeJS on that machine and try again. https://github.com/rails/execjs

chrisgit commented 8 years ago

Wow super quick response, thanks for that.

I've just installed therubyracer gem and minimart seems to be downloading cookbooks now.

Does minimart no longer need dep-selector-libgecode?

tapickell commented 8 years ago

No problem. I will have to look into dep-selector-libgecode not sure atm. I will update the readme to add a Javascript Runtime as a requirement.