Skip to content

Instantly share code, notes, and snippets.

@mcallegari10
Created December 18, 2017 01:16
Show Gist options
  • Save mcallegari10/c2a38cc5272d8a87bb71db2fe0f215ea to your computer and use it in GitHub Desktop.
Save mcallegari10/c2a38cc5272d8a87bb71db2fe0f215ea to your computer and use it in GitHub Desktop.
Ruby and SASS quick setup

Ruby

For the sole purpose to use SASS, you need to install Ruby the right way. That is with either RBENV or RVM. If you are not going to do the Ruby on Rails training, I highly encorage you to do it with RVM.

Installation

Run the following commands in your terminal:

gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB

\curl -sSL https://get.rvm.io | bash -s stable

When it's done downloading and installing RVM, run the command rvm list known to see the availabe Ruby versions to install. Install the latest version (at this point in time it's the 2.4) and then run rvm use <version-you-installed> and you should be now using the latest version.

Post Install

Now you need to add this line:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" 

to your terminal enviroment config file. It's the .bashrc or .zshrc located in your root folder. When you start a new instance of your terminal, you will now have Ruby installed! :D

SASS

Installation

You can install SASS by downloading the gem:

gem install sass

Usage

Run the following command in your terminal, in the root of your project:

sass --watch scss/application.scss:application.css

Now SASS is watching your SCSS main file and it will automatically compile as you save your changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment