Code Snippets and More

Heroku buildpacks are not smart enough to know how to compile our fancy *.scss files into CSS at every push. If we want to do it we have two different options.

Using Compass Gem

The build script bin/build

export GEM_HOME=$PWD/gems
mkdir -p $GEM_HOME
gem install compass
$GEM_HOME/bin/compass compile scss-dir css-dir

Using Bundler

Bundler is a dependency manager for ruby and is great for managing all your gems. Create Gemfile and add the following lines

source ""
gem "compass"

Then the build script will look like

export GEM_HOME=$PWD/gems
mkdir -p $GEM_HOME
LC_ALL=en_US.UTF-8 gem install bundler   # LC_ALL required by bundler
$GEM_HOME/bin/bundle install
$GEM_HOME/bin/bundle exec compass compile scss-dir css-dir

Recent comments

© 2014 Copyright by Keyvan Akbary