[Note: This post will baffle my usual readers. I intend to bifurcate (trifurcate?) my blog into multiple blogs in the near future: one for development-related stuff, another for startup-related stuff, and another for personal stuff. Until then, I feel that I have a responsibility to help those Googling for solutions to the exact same problems that have been befuddling me in my life as a programmer; this post is entirely for that purpose.]
I love Sass, the stylesheet-generating cousin of Haml. It’s so much syntactically sweeter than CSS, it lets you define variables and mixins like this handy border-radius shortcut, and it works seamlessly in Rails. And Sass 3 is the best version yet, for a number of reasons. Meanwhile, if you’re creating a new Rails project, the Creator Himself has proclaimed that you should be doing it with Rails 3.
But right now, the installation instructions for this lethal combination don’t exactly parse. So here’s what you need to do:
- Install the latest Rails (instructions here)
- Install the latest Haml/Sass distribution:
gem install haml --pre. (If you get an error, try updating RubyGems:gem update --system.) - Run
haml -vand note the version number. Mine is3.0.0.beta.3(delightfully code-named “Classy Cassidy.”) - Create a Rails project, e.g. with
rails ~/MyProject - Open up
Gemfilein the project root and add the linegem 'haml', '3.0.0.beta.3', substituting whatever the version number was in step 3.
And that’s it! Running haml --rails ~/MyProject appears to be harmless but unnecessary. If I’m wrong about that, someone please let me know.
Related: If you want to get Ruby 1.9 installed on your Mac, I strongly urge you to use Homebrew. If you’re curious about how to set Rubygems so that you don’t have to sudo it, follow the instructions at this page under the heading “Fixing Rubygems.
Tags: codingNo Comments

0 responses so far ↓
Comments are closed.