1
votes

I am using Sublime Text 2 (2.0.1, build 2217) on Mac OS X (10.7.2).

I have installed the SASS Build package, but every time I try to build the SASS file, I get the following error:

[Errno 2] No such file or directory

My path seems to be correct, and copying the cmd directly and pasting it into the terminal works, I'm really confused why it just isn't working from within ST2.

1
Sorry if I'm not understanding your question correctly, but exactly what cmd are you copying and pasting to build? - Tracy Fu
When running the build, ST2 shows the command it was trying to execute: [cmd: sass --update example.scss:example.css --stop-on-error --no-cache] which I can paste into terminal and works perfectly. - waffl
I found two possible leads. You may need to edit or add a path to your Sass Build package. If you look within the package in SASS.sublime-build, there's an OSX path setting (line 9). I found these two posts that look related to your problem: stackoverflow.com/questions/12311502/… and github.com/uipoet/sublime-jshint/issues/33. I don't feel confident enough to put this in an answer, but hopefully it points you in the right direction. - Tracy Fu

1 Answers

0
votes

Most likely such situation happened due to different Ruby versions installed on a machine. For example I have 1.8.7 installed with Mac OS X by default and later I installed 1.9.3 using rvm for multiuser environment (i.e. into /usr/local/rvm)

I set current version in rvm but GEM_HOME still points to gems from 1.8.7

The only straight and dumb solution I've found - hack environment variables for Sublime Text 2. This can be done creating .py file with any name in folder:

~/Library/Application Support/Sublime Text 2/Packages/User/

See more information in Rob Dodson's blog post: http://robdodson.me/blog/2012/05/14/hacking-the-path-variable-in-sublime-text/

Example .py that works for me:

import os

LOCAL = '/usr/local/bin:/usr/local/sbin:'
RVM = '/usr/local/rvm/bin:'
RVMGEMS = '/usr/local/rvm/gems/ruby-1.9.3-p392/bin:'
GEMHOME = '/usr/local/rvm/gems/ruby-1.9.3-p392'

# Sublime's default path is
# /usr/bin:/bin:/usr/sbin:/sbin
os.environ['PATH'] += ':'
os.environ['PATH'] += LOCAL
os.environ['PATH'] += RVM
os.environ['PATH'] += RVMGEMS

os.environ['GEM_HOME'] = GEMHOME

print 'PATH = ' + os.environ['PATH']