Why do I have to 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 is working. I feel like I am using a trash bag and a 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 even do. 开发者_Python百科I just read somewhere on stackoverflow that you had to add them for the app to work. Anyone know what these gems are for?
ExecJs - gives you the ability to, well - execute Javascript
RubyRacer - gives you the interface from Ruby to V8 engine.
Both are dependencies of the coffee-script
gem, which is used by Rails 3.1 and the asset pipeline.
ExecJS supports these runtimes:
therubyracer - Google V8 embedded within Ruby
therubyrhino - Mozilla Rhino embedded within JRuby
Node.js
Apple JavaScriptCore - Included with Mac OS X
Microsoft Windows Script Host (JScript)
therubyracer is not necessary, you can use any of the js runtimes instead, for example I use Node.js.
精彩评论