Rails 3.1 Hackfest - get rid of Javascript Runtime dependency in production
This weekend was Rails 3.1 Hackfest. The rails community was called to test the upcoming version 3.1 to its limits, to find bugs and or flaws and get it polished for the final release. So I did:
I’m working with the rails 3.1 since it first release candidate, but never tried in production. So I made my task to finally test this, and bring my app in the wild - on my (not root) server. Rails 3.0 is running there smoothly so I didn’t expect any problems - wrong!
Show stopper was the Javascript Runtime dependency on production. Reason was quickly found: Coffee-Script - ahrg! It depends on ExecJS, which depends on a Javascript Runtime. Unfortunately, and that’s because I’m not on a root server, I got neither node.js, therubyraser, Mustang nor Johnson installed there.
I read this article, which supposed to precompile the assets - didn’t help either and runtime is needed again.
In the End, the solution was as simple as obvious: just don’t use coffee-script in production :-) I did, removed the coffee-script gem form my Gemfile - and tatatata: it works! Uhh! This took me quite a long time to get it right. Javascript Runtime dependecy no good for prodcution, and reading Mr. Katz it’s looking good to get this fixed for the final release - uff! Happy so get tin final one soon! Yeah!
[cheesey image taken from PragDave - thx]