[Rails] ExecJS :: RuntimeUnavailable solution

Solution → Install mini_racer

When I tried to start the server with rails s after updating the Mac OS, an error occurred.

Terminal


Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. 
(ExecJS::RuntimeUnavailable)

If you look it up, you don't have the runtime needed to execute JavaScript! It seems to say.

Looking for a solution, it seems that the error statement has a link to the list of available runtimes at https://github.com/rails/execjs.

There was information in it that gem'mini_racer' seemed to be good, so I decided to bundle install. As a result, you can start the server safely!

Conclusion

Gemfile


#Added at the bottom
gem 'mini_racer'

Let's bundle install.

Recommended Posts

[Rails] ExecJS :: RuntimeUnavailable solution
Solution for ExecJS :: RuntimeError.
[Solution] Rails6 Webpacker :: Manifest :: MissingEntryError
[Solution] Webpacker :: Manifest :: MissingEntryError in Rails