Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Start a free Basic trial
to watch this video
The quickest way to start using Sass is with the command line. In this video, we'll cover a few commands for installing—and updating—Sass on your computer.
Quick Reference
- Installing Sass
- Related forum posts
- The Friendliest Guide About Installing and using Sass on Windows
Install Sass on Windows
From the sass-lang.com instructions:
Before you start using Sass you will need to install Ruby. The fastest way to get Ruby on your Windows computer is to use Ruby Installer. It's a single-click installer that will get everything set up for you super fast.
The installer will also install a Ruby command line powershell application that will let you use the Ruby libraries.
Installing the Sass pre-release
Use the command:
gem install sass --pre
To rollback:
gem uninstall sass
Then:
gem install sass
You can also specify the version. Ex:
gem install sass -v 3.4.13
Updating Sass
gem update sass
Related Videos
-
0:00
Before we install Sass,
-
0:01
let's go over a few misconceptions we might have about using Sass.
-
0:05
So, the first one might be, there's no point in attempting Sass
-
0:09
unless you've had experience with the console, Git and Ruby.
-
0:13
Or we may think that to use Sass,
-
0:15
we'll need to know a ton of commands to make everything work.
-
0:18
And Sass steers too far from CSS, we have to learn a new language.
-
0:23
Well first, if you think you'll need to know Ruby to install and use Sass,
-
0:26
don't worry because you don't.
-
0:28
Hey, I'm not even close to being a Rubyist.
-
0:30
And we'll just need to know a few friendly commands to get up and running.
-
0:34
It won't be scary, I promise, and
-
0:36
finally, since Sass is a subset of CSS, it's not a new language.
-
0:40
We don't even need to use Sass syntax if we don't want to.
-
0:43
Writing plain CSS is actually writing valid Sass.
-
0:47
Yes, it is an extra layer of obstruction we're adding to our workflow, but
-
0:50
it's a powerful layer that, like I said, makes writing CSS more efficient, cleaner,
-
0:55
maintainable, and most of all, fun.
-
0:58
Sass lives and works locally on our machine, so
-
1:02
we really can't do anything just yet until we have Sass installed on our computers.
-
1:06
Since Sass is a Ruby gem,
-
1:08
we'll need to have Ruby installed on our machine in order to install Sass.
-
1:13
But, as I mentioned earlier,
-
1:14
don't worry because we don't need to know any Ruby to install and use Sass.
-
1:19
And if you're working on a Mac, chances are, you already have Ruby installed.
-
1:23
Now, it may sound a little nerve-racking, but
-
1:26
honestly, the quickest way to start using Sass is with the command line.
-
1:30
So, first things first, since I'm on a Mac, I'll need to bring up Terminal, and
-
1:34
that's where we'll write our commands.
-
1:36
So on the Mac, the Terminal app comes installed by default, and
-
1:39
it's located in our Utilities folder.
-
1:43
And don't worry if you're running Windows machine.
-
1:45
I've posted the windows installation instructions in the teacher's notes.
-
1:48
They're very similar.
-
1:50
Next, inside Terminal, or in your Command Prompt, we'll install Sass by
-
1:55
writing the command gem install sass, then hit Enter.
-
2:02
Now this command goes out and fetches the latest version of Sass and
-
2:06
installs it on our computer.
-
2:09
Now, if we get an error message after running this command,
-
2:12
it will likely be a permissions error.
-
2:14
For example, here we're getting an error that says,
-
2:17
you don't have write permissions for the Ruby/Gems directory.
-
2:21
Now if we see this error,
-
2:23
we'll need to use the command sudo gem install sass instead.
-
2:29
[SOUND] Sudo allows us to run the installation without the permission
-
2:33
problems.
-
2:34
It sort of puts us in a super user mode to get around permission issues.
-
2:38
Now it does ask us to enter our password to confirm the installation.
-
2:43
And this will usually be your user account login password.
-
2:47
And once we do that, it grants us the permissions to install and run Sass.
-
2:51
[SOUND]
-
2:53
[BLANK_AUDIO]
-
2:55
All right, so now let's make sure that we have Sass installed on our computer.
-
3:00
And we can do that by typing the command sass -v.
-
3:05
[SOUND] And once we hit Enter, if all goes well,
-
3:08
this returns the version of Sass we've installed.
-
3:11
In this case, it's Sass 3.4.13, Selective Steve.
-
3:18
Now your version might be different,
-
3:20
most likely a higher version compared to the version at the time of this recording.
-
3:24
And that's okay.
-
3:25
That just means you have the very latest version of Sass installed.
-
3:29
All right, so it looks like we're all set with our installation.
-
3:33
But what if we only need to update to the latest version of Sass?
-
3:37
Let's say you've already installed Sass in the past, and
-
3:40
now you just need to update it.
-
3:42
Well, to do that, we'll need to type the command, gem update sass.
-
3:48
[SOUND] And again, if you get any permissions errors doing this,
-
3:53
you'll need to run it under sudo.
-
3:55
So, with update command, we'll be all up to date.
-
3:58
Now, we just did a fresh install, so there's nothing to update at the moment.
-
4:03
Finally, if you wanna be on the bleeding edge and
-
4:06
start using the Sass features of tomorrow, today, take a look at how you can install
-
4:10
the pre-released version of Sass in the teacher's notes.
You need to sign up for Treehouse in order to download course files.
Sign up