File under “Things for me to remember when reinstalling stuff”
However, I ran into a slight problem when following Dr Nic’s setup tutorial today. CoffeeScript worked, bistro_car worked within the console, but it didn’t work when accessing the page through the browser. But some path re-working, and a kind word or two from @sutto, and we’re good to go.
For future reference, here’s what I did. I’m using the homebrew package manager. Mainly because it’s awesome, and I use MacOS X, which is also awesome.
So, I installed node.js, coffeescript and bistro_car like so:
brew install node brew install coffee-script gem install bistro_car
Then, add the following to your environment.rb file:
Create an ‘app/scripts’ directory in your Rails app, which is where you can store all your .coffee files (application.coffee etc).
You then get bistro_car to include those script files by putting this in your layout/template/page/whatever:
As with almost every problem on a *nix computer, the problem is a path one, and thankfully solved with some simple symlinks. It seems passenger operates in it’s own little world when it comes to paths, and it just didn’t want to play nice with my environment. So, I tricked it as follows:
sudo ln -s /usr/local/bin/coffee /usr/bin/coffee sudo ln -s /usr/local/bin/node /usr/bin/node
And that, my friend, is how you skin the unix path cat.