Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS Sass Basics (retired) Getting Started with Sass Installing and Using Sass

Shin And
Shin And
8,924 Points

Sass Compiler can not find .scss files

Sass 3.4.9 version was confirmed and loaded to my Mac

It appears that my Sass Compiler has been place in a improper directory/folder. When running the test.scss within terminal; I received the following message:

-bash: test.scss: command not found

How can I locate the directory or folder that the Sass compiler has been placed in, and move to it’s proper location; such that all saved Sass files can be access by the Sass compiler within Terminal.

9 Answers

Got it. In that video the instructor types "sass test.scss" and not just "test.scss".

Sass is the command so it always needs to be included before the file you want to run it on.

One other possibility is that within your terminal you are not in the right project directory.

Wish there was a way for me to see exactly what you were doing but I hope including 'sass' before the file works for you. If not come back here and I will try to more articulately express the necessary steps.

Shinny,

Can you see where you saved your files? If not just do this.

  1. Open terminal and type cd ~/Desktop && touch test.scss
  2. Open the file in Sublime text
  3. Paste your code into the new file.
  4. Back to terminal. Type sass test.scss

Let me know if you need more help.

Also, do you have Ruby installed on your computer?

Kieran Baybutt
Kieran Baybutt
7,119 Points

Hi, do you know how to keep it so it opens as desktop every time I open terminal? So I don't have to type in cd ~/Desktop && touch test.scss every time I open terminal. Thanks.

Kieran Baybutt Are you running OSX? And if yes, do you have a .bashprofile or .bashrc?

Hi Shinny, 'test.scss' is not a command. Are you in your projects directory when trying to compile the scss files?

Shin And
Shin And
8,924 Points

John (thx for the rapid response)

It’s the second step within the Sass Basics. The instructor requires users to create a test.scss file with Sublime. This ensures that the Sass Compiler is properly working.

Once the file has been created and saved, we are instructed to return back to the terminal window and type in the following: test.scss. The compiler results should match those of the instructor, I received and error.

I believe the location of the Sass Compiler and my files are in two different folders/directories. If I can get them in the same directory/file folder I'll be in good shape. Listed below is a play by play (aka my steps)

MY STEPS: Loaded Sass with the command line Sass was Install successfully Confirmed the Version Sass 3.4.9 version was confirmed and loaded to my Mac Created the test.scss file with Subline and saved it out

typed sass test.scss into my terminal it returned the following message: -bash: test.scss: command not found

Shin And
Shin And
8,924 Points

John

Your have knee eyes, and attention to detail, however that did not work.

My files are probably not in the projects directory. The instructor saved his files to the desktop; they were accessible to the Sass Compiler. Can you provide any advice on how to check my current directory, as well as how to move from one directory to another.

How are your Terminal command line skills?

Shin And
Shin And
8,924 Points

Jared

Yur the mann! That worked!

Hey, how did you lean Terminal Command Code? Do you have any tutorials/info which can help me learn how to navigate directories and files, using the Terminal?

Ruby on the my Mac, I believe so... Ruby comes standard on all Mac's correct?? and has to be installed prior to loading the Sass??

Glad that worked.

I'm mostly self taught but I did the Command Line course here on Treehouse and you could also do this one. http://cli.learncodethehardway.org/

I was just making sure. I don't use sass really from the terminal. I use Compass and Grunt and I manage everything through that. That is a whole different course though. lol

Shin And
Shin And
8,924 Points

Thanks again.

I will definitely check out the Command Line Course.

Are you a Grunt Guru? & have you used it with Gypsy? I ran across a Grunt Gypsy combo on CSS Tricks a while back, was super impressed.. been looking for comprehensive Grunt/Gypsy Tutorials, ever since..

I loaded Grunt to see if I could get the "watch" feature working a while back, and ran to the same issue. Meaning it loaded through Node then I ran a few Terminal commands with limited success.

It always seems like the files are hidden, and my working files are never in the same directory as the app/compilers installed thru the Terminal Command Line.

Do you mind if I hit you up with questions from time to time?

Shin And
Shin And
8,924 Points

Hey Kieran

Listed below are a few notes, hopefully they help.

  1. Open your Terminal
  2. Type in the following command pwd (stands for "print working directory" This will display your current directory
  3. Type in the command Ls (this will list all files within your current directory) Ls should return/display the following: Applications Documents Movies Downloads Desktop
  4. Type in the command cd desktop (places you within the computer desktop)
  5. Next type in sass --watch "your folder name"