You should run following command to install NodeJS in Ubuntu
sudo apt-get install nodejs
or run this for OSX
brew install nodejs
Uglifier is a JS wrapper and it needs a JS runtime running or JS interpreter. I would choose to install NodeJS.
In the default Rails Gemfile, the line for the gem 'therubyracer' is commented out. If you uncomment it, you'll get that gem and it should work.
From "Getting Started with Rails":
Compiling CoffeeScript and JavaScript asset compression requires you have a JavaScript runtime available on your system, in the absence of a runtime you will see an
execjs
error during asset compilation. Usually Mac OS X and Windows come with a JavaScript runtime installed. Rails adds thetherubyracer
gem to the generatedGemfile
in a commented line for new apps and you can uncomment if you need it.therubyrhino
is the recommended runtime for JRuby users and is added by default to theGemfile
in apps generated under JRuby. You can investigate all the supported runtimes at ExecJS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With