Ruby

James Ingmire
James Ingmire
11,901 Points

'Errno::ENOENT: No such file or directory' - Help with starting up Sass please.

Just started on the sass course finally, running from a Windows pc, installed the ruby files etc. On the command line checked its installed and running <Maptastic Maple> 3.3.4. Saved a test.scss file on the desktop and then checked with the line 'sass test.scss' in the 'Start Command Prompt with Ruby' window, however get the error 'Errno::ENOENT: No such file or directory - test.scss.' Can anyone help as the tutorial seems to be focused on a Mac op.

Thank you in advance.

3 Answers

Kevin Lozandier
PRO
Kevin Lozandier
Pro Student 53,746 Points

Hi, James:

A long-time user of Sass on Windows here (and currently).

First and foremost, I highly recommend using SassMeister or Codepen to follow along the class quickly and conveniently.

Second Parameter for the desired output filename is needed

When it comes to your problem, do realize that you must be both in the correct directory with your cmd and pass in as a second parameter what you want the the .scss or .sass to be called. The same applies with the -w option.

# test.sass 

div 
  width: 40vw 

If you just type sass t.sass the following will happen in the terminal:

sass test.sass 
div { 
  width: 40vw; 
}

You need to type in the name you want the outfile file to be if you want it to compile a specific file instead of a specific folder:

sass test.sass test.css 

That will create test.css. The better way is to watch the file of course for sass to autoiupdate things; things are a bit different

sass --watch test.sass:test 
>>> Sass is watching for changes. Press Ctrl+C to stop. 

You give an option parameter to sass to inform it to deviate from its normal behavior to watch instead a specific file and folder. Based on the rules established by the method, it expects an input file or folder separated from what you want the output to be by a colon (:)

Correct Directory

Make sure you're in the correct place. Your terminal or cmd should have started inside your user folder. From there, you should have been able to navigate to your desktop:

cd desktop
sass test.sass test.css 

If that's not working, feel free to reply and I'll reply as soon as I'm able to.

James Ingmire
James Ingmire
11,901 Points

Thank you. Got it working, realized also that the directory path on windows cmd needs to be changed to the specific folder your files are of course but do wish treehouse would explain this in the video for the window user.

Heres a link for future people how to change directories in windows command prompt.

Thanks again for your detailed help.

Kevin Lozandier
Kevin Lozandier
Pro Student 53,746 Points

The class, at least all front-end tracks, expects people to have completed the Console Foundations course.

With that course being a prerequisite, most would have such knowledge to change directories within 5-10 minutes from taking a lesson from that course.

From what I can see from your profile you haven't taken that course. I highly recommend you do. It's not relied on too much in this class, especially with the fact you can use Codepen or SassMeister to follow along.

Even if you identify yourself as a web designer, it's now a very important skillset to have if you plan on being efficient with your use of preprocessors such as Sass.

James Ingmire
James Ingmire
11,901 Points

Yea thanks did not know that. Glad treehouse is making the correct structure of videos more clear now, think its a very good idea so you know what to learn in what order. Thanks again for your help I will definitely get to the 'console foundations course' right away. How have you got so many points by the way? Did not know was possible! Great achievement.