Error ExecJS :: RuntimeUnavailable: What to do when it occurs

Occurrence phenomenon

The following Error occurs when executing $ rake secret when setting environment variables when setting the Web server and application server on AWS EC2.

terminal


ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
/var/www/chat-space/config/application.rb:7:in `<top (required)>'
/var/www/chat-space/Rakefile:4:in `require_relative'
/var/www/chat-space/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)

→ Javascript is not running well, so install Node.js.

install confirmation

In a local environment

terminal


$ node --version
v12.16.1

Install in AWS production environment

terminal


sudo yum install nodejs --enablerepo=epel ← execute
Loaded plugin:priorities, update-motd, upgrade-helper
amzn-main                                                          | 2.1 kB  00:00:00     
amzn-updates                                                       | 3.8 kB  00:00:00     
epel/x86_64/metalink                                               | 5.3 kB  00:00:00     
epel                                                               | 4.7 kB  00:00:00     
nodesource                                                         | 2.5 kB  00:00:00     
(1/3): epel/x86_64/group_gz                                        |  74 kB  00:00:00     
(2/3): epel/x86_64/updateinfo                                      | 789 kB  00:00:00     
(3/3): epel/x86_64/primary_db                                      | 6.1 MB  00:00:00     
1073 packages excluded due to repository priority protections
Resolving dependencies
-->Performing transaction confirmation.
--->Package nodejs.x86_64 2:6.17.1-Install 1nodesource
-->I'm dealing with dependencies: python >= 2.6 packages: 2:nodejs-6.17.1-1nodesource.x86_64
-->Performing transaction confirmation.
--->Package python26.x86_64 0:2.6.9-2.89.Install amzn1
-->I'm dealing with dependencies: libpython2.6.so.1.0()(64bit)Package: python26-2.6.9-2.89.amzn1.x86_64
-->Performing transaction confirmation.
--->Package python26-libs.x86_64 0:2.6.9-2.89.Install amzn1
-->Dependency resolution finished.

Resolved the dependency

==========================================================================================
Package architecture
Version repository capacity
==========================================================================================
During installation:
 nodejs               x86_64        2:6.17.1-1nodesource          nodesource         13 M
Dependency related installation:
 python26             x86_64        2.6.9-2.89.amzn1              amzn-main         5.8 M
 python26-libs        x86_64        2.6.9-2.89.amzn1              amzn-main         697 k

Transaction summary
==========================================================================================
Installation 1 package(+Two dependency packages)

Total download capacity: 20 M
Installation capacity: 59 M
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/latest/nodesource/packages/nodejs-6.17.1-1nodesource.x86_64.rpm:Header V4 RSA/SHA512 Signature, key ID 34fa74dd: NOKEY
nodejs-6.17.1-1nodesource.x86_64.rpm public key is not installed
(1/3): nodejs-6.17.1-1nodesource.x86_64.rpm                        |  13 MB  00:00:00     
(2/3): python26-libs-2.6.9-2.89.amzn1.x86_64.rpm                   | 697 kB  00:00:00     
(3/3): python26-2.6.9-2.89.amzn1.x86_64.rpm                        | 5.8 MB  00:00:01     
------------------------------------------------------------------------------------------
16 MB in total/s |  20 MB  00:00:01     
file:///etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-Obtaining the key from EL.
Importing GPG key 0x34FA74DD:
 Userid     : "NodeSource <[email protected]>"
 Fingerprint: 2e55 207a 95d9 944b 0cc9 3261 5ddb e8d4 34fa 74dd
 Package    : nodesource-release-el7-1.noarch (installed)
 From       : /etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL
Perform the above processing. is this good?[y/N]y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
During installation: python26-libs-2.6.9-2.89.amzn1.x86_64                     1/3 
During installation: python26-2.6.9-2.89.amzn1.x86_64                          2/3 
During installation: 2:nodejs-6.17.1-1nodesource.x86_64                        3/3 
During verification: 2:nodejs-6.17.1-1nodesource.x86_64                        1/3 
During verification: python26-2.6.9-2.89.amzn1.x86_64                          2/3 
During verification: python26-libs-2.6.9-2.89.amzn1.x86_64                     3/3 

Installation:
  nodejs.x86_64 2:6.17.1-1nodesource                                                      

I have installed dependency related:
  python26.x86_64 0:2.6.9-2.89.amzn1        python26-libs.x86_64 0:2.6.9-2.89.amzn1       

Has completed!

With the above, javascript can be run even in the production environment.

Recommended Posts

Error ExecJS :: RuntimeUnavailable: What to do when it occurs
What to do when javax.batch.operations.JobStartException occurs
What to do when a Remove Error occurs when updating conda
What to do when an error occurs with import _ssl
What to do when a javax.el.PropertyNotWritableException occurs
[Beanstalk] What to do when an error occurs with import uuid
What to do when IllegalStateException occurs in PlayFramework
What to do when PermissionError of tempfile.mkstemp occurs
What to do if an error occurs when importing numpy with VScode
[OSX] [pyenv] What to do when an SSL error occurs in pip
What to do if an error occurs when nokogiri enters when bundle install
What to do if ClassNotFoundException occurs when starting Tomcat
What to do if an ActionController :: UnknownFormat error occurs
[python] What to do when an error occurs in send_keys of headless chrome
What to do when SSL error occurs in pip in Windows10, miniconda, VScode environment
What to do when Ubuntu crashes
What to do when it becomes Unable to find CDI BeanManager.
What to do if a 0xC0000005 error occurs in tf.train.start_queue_runners ()
[Python] Type Error:'WebElement' object is not iterable What to do when an error occurs
What to do when ModuleNotFoundError: No module named'XXX' occurs in Python
What to do when UnicodeDecodeError occurs during read_csv in pandas (pd.read_table ())
What to do when undefined method ʻuser_signed_in?'
What to do when an UnsupportedCharsetException occurs in a lightweight JRE
[Rails 6] What to do when a missing a template error occurs after introducing haml [Super easy]
What to do if a SAX Parser error occurs when using Liferay 7 / DXP on AWS
[Python] What to do when an error related to SSL authentication is returned
What to do if an error occurs due to urllib3 in Check! docker-compose
[Docker] What to do when error Couldn't find the binary git appears
What to do when pyinstaller: error: argument --add-binary: invalid add_data_or_binary value: appears
What to do if you get an error when trying to load mnist
What to do when psycopg2 throws an error when pipenv lock under Pipenv environment
Notes on what to do when a WebView ClassNotFoundException occurs in JavaFX 12
What to do when debugging "Source not found"
What do you use when converting to String?
[Django] What to do if an Integrity Error occurs when registering data from the management site to the database
What to do if CERTIFICATE_VERIFY_FAILED occurs when nltk.download () is done on macOS pyhon
What to do if you get an error when installing python with pyenv
What to do if a version error occurs in the selenium Chrome driver
[Grails] Error occurred running What to do when the Grails CLI does not start
What to do if a Unicode Encode Error occurs in Sublime Text Python
What to do when is invalid because it does not start with a'-'
wildflly10 java8 ERROR [org.jboss.jca.core.tx.jbossts.XAResourceRecoveryImpl] (Periodic Recovery) IJ000906 What to do if an error occurs
What to do if a UnicodeDecodeError occurs in pip
What to do when "cannot import name xxx" [Python]
ParseException: What to do when Unparseable date is reached
When I tried to start GlassFish, I got an internal error while "Publishing to GlassFish 4.0 on localhost ...". What to do when it becomes
What to do if an error occurs when loading a python project created with poetry into VS Code
[openpyxl] What to do when IllegalCharacterError appears in pandas.DataFrame.to_excel
curl: (60) What to do when Issuer certificate is invalid.
[Go 1.13] What to do when unexpected directory layout: appears
What to do if a compile error occurs when you try to calculate sha1 in C language of OSX
What to do when JSF tags do not become HTML
What to do when The SSL certificate has expired
What to do if you get an error when importing matplotlib in Python (Mac)
What to do when "Type Error: must be _socket.socket, not socket" appears on GAE
fatal error: stdio.h: No such file or directory #include What to do when <stdio.h> appears
What to do if you get the error ʻERR_FEATURE_UNAVAILABLE_ON_PLATFORM` when using ts-node-dev on Linux
After installing'devise''bootstrap' of gemfile with rails, what to do when url is an error
What to do if you get an Import Error when importing matplotlib with Jupyter
What to do if you get an OpenSSL error when installing Python 2 with pyenv
What to do if you get a memory error when converting from PySparkDataFrame to PandasDataFrame