Bummer! This is just a preview. You need to be signed in with a Treehouse account to view the entire video.
Installing and Updating Sass4:13 with Guil Hernandez
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.
- 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
gem uninstall sass
gem install sass
You can also specify the version. Ex:
gem install sass -v 3.4.13
gem update sass
Before we install Sass,
let's go over a few misconceptions we might have about using Sass.
So, the first one might be, there's no point in attempting Sass
unless you've had experience with the console, Git and Ruby.
Or we may think that to use Sass,
we'll need to know a ton of commands to make everything work.
And Sass steers too far from CSS, we have to learn a new language.
Well first, if you think you'll need to know Ruby to install and use Sass,
don't worry because you don't.
Hey, I'm not even close to being a Rubyist.
And we'll just need to know a few friendly commands to get up and running.
It won't be scary, I promise, and
finally, since Sass is a subset of CSS, it's not a new language.
We don't even need to use Sass syntax if we don't want to.
Writing plain CSS is actually writing valid Sass.
Yes, it is an extra layer of obstruction we're adding to our workflow, but
it's a powerful layer that, like I said, makes writing CSS more efficient, cleaner,
maintainable, and most of all, fun.
Sass lives and works locally on our machine, so
we really can't do anything just yet until we have Sass installed on our computers.
Since Sass is a Ruby gem,
we'll need to have Ruby installed on our machine in order to install Sass.
But, as I mentioned earlier,
don't worry because we don't need to know any Ruby to install and use Sass.
And if you're working on a Mac, chances are, you already have Ruby installed.
Now, it may sound a little nerve-racking, but
honestly, the quickest way to start using Sass is with the command line.
So, first things first, since I'm on a Mac, I'll need to bring up Terminal, and
that's where we'll write our commands.
So on the Mac, the Terminal app comes installed by default, and
it's located in our Utilities folder.
And don't worry if you're running Windows machine.
I've posted the windows installation instructions in the teacher's notes.
They're very similar.
Next, inside Terminal, or in your Command Prompt, we'll install Sass by
writing the command gem install sass, then hit Enter.
Now this command goes out and fetches the latest version of Sass and
installs it on our computer.
Now, if we get an error message after running this command,
it will likely be a permissions error.
For example, here we're getting an error that says,
you don't have write permissions for the Ruby/Gems directory.
Now if we see this error,
we'll need to use the command sudo gem install sass instead.
[SOUND] Sudo allows us to run the installation without the permission
It sort of puts us in a super user mode to get around permission issues.
Now it does ask us to enter our password to confirm the installation.
And this will usually be your user account login password.
And once we do that, it grants us the permissions to install and run Sass.
All right, so now let's make sure that we have Sass installed on our computer.
And we can do that by typing the command sass -v.
[SOUND] And once we hit Enter, if all goes well,
this returns the version of Sass we've installed.
In this case, it's Sass 3.4.13, Selective Steve.
Now your version might be different,
most likely a higher version compared to the version at the time of this recording.
And that's okay.
That just means you have the very latest version of Sass installed.
All right, so it looks like we're all set with our installation.
But what if we only need to update to the latest version of Sass?
Let's say you've already installed Sass in the past, and
now you just need to update it.
Well, to do that, we'll need to type the command, gem update sass.
[SOUND] And again, if you get any permissions errors doing this,
you'll need to run it under sudo.
So, with update command, we'll be all up to date.
Now, we just did a fresh install, so there's nothing to update at the moment.
Finally, if you wanna be on the bleeding edge and
start using the Sass features of tomorrow, today, take a look at how you can install
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