3 ms·
You'll need to add 'therubyracer' (or another javascript interpreter) to your Gemfile. It requires python and a C++ compiler to compile its binaries. If you're
by nfm 15y ago
You'll need to add 'therubyracer' (or another javascript interpreter) to your Gemfile. It requires python and a C++ compiler to compile its binaries.
If you're on Heroku, you may need 'therubyracer-heroku' instead - there are compilation issues. Hopefully this will be fixed soon.
- tomfakes 15y agoThis needs the V8 stuff compiled and installed. And then I'm running yet more code on my production servers to deploy. And this code compiles the CoffeeScript to JS, and this will be the very first place that this code will have actually been tested in this configuration. This deployment scares me a lot -- partly because I haven't yet made it work in an RC build, and mainly because it adds more moving parts to my production servers.
- rubymaverick 15y agoYou do not need to use CoffeeScript in Rails 3.1, it is merely the default option. Just delete the "gem 'coffeescript'" line in your Gemfile and just use regular js.
- bonzoesc 15y agoThat's the problem though; Rails now depends on an implementation of a second programming language (coffeescript) that's only implemented inside another language environment (node.js) that changes quickly enough that many OSes don't have working packages for it. Coffeescript is rad as hell, but making Rails depend on it by default without a really great way to install it seems foolish.
- chanks 15y agoNode.js isn't required. You can use any of the seven javascript runtimes that the ExecJS gem supports. https://github.com/sstephenson/execjs https://github.com/sstephenson/execjs
- ebiester 15y ago:s/Node.js/Not Ruby
- skidooer 15y agoI admittedly haven't spent much time with Rails 3.1, but isn't that what rake assets:precompile is for? Automatic compilation of coffee scripts is nice in development, but not overhead you want to add for production anyway.