Getting back into the latest Rails and installing the latest version of the greatest HTML markup system ever was a little tougher than expected. Turns out the new hotness with Rails since 2.1 is to config.gem everything, which makes sense. This doesn't work well for things like HAML, which expect to be plugins. Luckily you can conform to the new trend without littering your vendor/plugins folder.
Installing HAML and Sass
You must first do a basic gem install of haml thusly:
$ sudo gem install haml
Once completed you'll need to add the following to your environment.rb
Next comes the cool trick...
As of Rails 2.0, the default load order for configuration is as follows:
- config/preinitializer.rb (if the file exists)
- config/environments/* (defaults to your current environment)
You have to place the following in a new file inside the config/initializers/ folder (I called mine hamlandsass.rb) in order to get HAML to properly load, which allows you to configure its options as well.
Once you add that, SASS will work beautifully and allow you to configure it normally.Share