Andrew Kordampalos
← Writing1 min read

Rails and Compass for noobs!

Originally posted on Tumblr on

Yes I’m noob too. At least on the rails part at the moment. And if you enjoy writing CSS with Sass and Compass but you don’t know how to start, this post is for you!

Some months ago (I just now find time to write this post) I was looking how to install compass in my already existing rails project. With a quick google search or even with an extensive google search, all the the results talking about static project or new compass stand-alone project. I found nothing about how to install compass really fast an easy like the following post.

I don’t want to spend your time, I know you are here to see how to do it, so here we are!

Open your Gemfile and in the assets group add the gem we need, the compass-rails gem.

...
...
# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'compass-rails'
...
...

That’s it, yes only this! Now stop your server if it’s turned on, run bundle install to install the gem we just added and you are ready!

You can now start using these cool compass functions with ease :)

@import "compass/css3/border-radius";

Enjoy!

Enjoyed this? Get the next one by email.

No spam. Unsubscribe anytime.

Andrew KordampalosAI Growth at Zapier · New York