Why should I add execjs and therubyracer to my gemfile for rails3.1 to work?

I donโ€™t like being in situations where I donโ€™t understand why something works. I feel like I'm using a trash bag and rubber band to fix a leaky pipe. Since upgrading to rails3.1, I have not been able to get it to work unless I add "execjs" and "therubyracer" to the gemfile. I do not understand what these gems are doing. I just read somewhere in stackoverflow that you had to add them for the application to work. Does anyone know what these gems are for?

+4
source share
2 answers

ExecJs - gives you the ability to execute Javascript well

RubyRacer - gives you an interface from the Ruby to V8 engine.

Both are coffee-script gem dependencies that are used by Rails 3.1 and the asset pipeline.

+19
source

ExecJS supports these time intervals:

therubyracer - Google V8 embedded in Ruby

therubyrhino - Mozilla Rhino embedded in JRuby

Node.js

Apple JavaScriptCore - included with Mac OS X

Microsoft Windows Script Host (JScript)


therubyracer is not required, you can use any of js runtimes, for example, I use Node.js.

+5
source

All Articles