Bug 1392234

Summary: Generating new controller fails with Could not find a JavaScript runtime
Product: [Community] softwarecollections.org Reporter: Lukas Zapletal <lzap>
Component: rh-ror42Assignee: Jakub Dorňák <jdornak>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.0CC: hhorak, vondruch
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-07 12:06:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Lukas Zapletal 2016-11-06 16:05:22 UTC
[root@ibm-x3650m4-02-vm-05 project]# rails generate controller pages
/opt/rh/rh-ror42/root/usr/share/gems/gems/execjs-2.2.0/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 /opt/rh/rh-ror42/root/usr/share/gems/gems/execjs-2.2.0/lib/execjs.rb:5:in `<module:ExecJS>'
        from /opt/rh/rh-ror42/root/usr/share/gems/gems/execjs-2.2.0/lib/execjs.rb:4:in `<top (required)>'
        from /opt/rh/rh-ror42/root/usr/share/gems/gems/uglifier-2.4.0/lib/uglifier.rb:3:in `require'
        from /opt/rh/rh-ror42/root/usr/share/gems/gems/uglifier-2.4.0/lib/uglifier.rb:3:in `<top (required)>'
        from /opt/rh/rh-ruby23/root/usr/share/gems/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `require'
        from /opt/rh/rh-ruby23/root/usr/share/gems/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
        from /opt/rh/rh-ruby23/root/usr/share/gems/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `each'
        from /opt/rh/rh-ruby23/root/usr/share/gems/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `block in require'
        from /opt/rh/rh-ruby23/root/usr/share/gems/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `each'
        from /opt/rh/rh-ruby23/root/usr/share/gems/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `require'
        from /opt/rh/rh-ruby23/root/usr/share/gems/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
        from /root/project/config/application.rb:7:in `<top (required)>'
        from /opt/rh/rh-ror42/root/usr/share/gems/gems/spring-1.4.0/lib/spring/application.rb:82:in `require'
        from /opt/rh/rh-ror42/root/usr/share/gems/gems/spring-1.4.0/lib/spring/application.rb:82:in `preload'
        from /opt/rh/rh-ror42/root/usr/share/gems/gems/spring-1.4.0/lib/spring/application.rb:143:in `serve'
        from /opt/rh/rh-ror42/root/usr/share/gems/gems/spring-1.4.0/lib/spring/application.rb:131:in `block in run'
        from /opt/rh/rh-ror42/root/usr/share/gems/gems/spring-1.4.0/lib/spring/application.rb:125:in `loop'
        from /opt/rh/rh-ror42/root/usr/share/gems/gems/spring-1.4.0/lib/spring/application.rb:125:in `run'
        from /opt/rh/rh-ror42/root/usr/share/gems/gems/spring-1.4.0/lib/spring/application/boot.rb:18:in `<top (required)>'
        from /opt/rh/rh-ruby23/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /opt/rh/rh-ruby23/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
        from -e:1:in `<main>'

Looks like a dependency is missing.


The same error when I attempt to start the server.

Followed: https://www.softwarecollections.org/en/scls/rhscl/rh-ror42/

Instructions
You can get started in three easy steps:

# 1. Install a package with repository for your system:
# On CentOS, install package centos-release-scl available in CentOS repository:
$ sudo yum install centos-release-scl

# On RHEL, enable RHSCL repository for you system:
$ sudo yum-config-manager --enable rhel-server-rhscl-7-rpms

# 2. Install the collection:
$ sudo yum install rh-ror42

# 3. Start using software collections:
$ scl enable rh-ror42 bash
At this point you should be able to use rails just as a normal application. Examples of commands run might be:

$ rails new project
$ cd project
$ rails server -p 8080
$ rails generate controller pages

Comment 1 Vít Ondruch 2016-11-07 10:49:00 UTC
Thx for the report.

I'd say that this is somewhat expected, since we don't enable nodejs collection by default (although it is pulled in when the metapackage is installed). But the documentation should be clarified.

Comment 2 Vít Ondruch 2016-11-07 11:03:16 UTC
I think the simplest change could be s/\$ scl enable rh-ror42 bash/\$ scl enable rh-nodejs4 rh-ror42 bash/ ... I am not sure we should go more into details ...

Comment 3 Vít Ondruch 2016-11-07 12:06:16 UTC
The documentation was fixed.

Comment 4 Lukas Zapletal 2016-11-07 14:22:44 UTC
Thanks folks!