Error when running rails app - ExecJS::RuntimeError

you have to install an additional gem for javascript. edit gemfile and add gem 'therubyracer'. You can then run bundle to install the new gem.

here is your solution in detail:

It happened to me too! You need to install "nodejs". As I work with Ubuntu Linux I did:

apt-get install nodejs 

Source: (Sam Ruby's post)

If you are having this problem in production server this might be due to memory usage. while doing assets precompilation server use lot of memory.

consider restarting your production server.