0
votes

Problem description:

I am using Emacs scss-mode on Macbook Air, the problem is when I save *.scss file , it said: can not find the SASS command.

I can run SASS command in the terminal (I installed by sudo gem install sass). But where is the SASS executable command path, so I can update my .emacs file accordingly?

I searched ~/.gem/ , /usr/lib/gem/ directory, but failed to find sass. Now I just disabled scss compilation function , but it's really inconvenient.


So I find sass using "find".

Change to .emacs is as below:

  1. Add sass PATH to emacs PATH:

(setenv "PATH" (concat "/Library/Ruby/Gems/2.0.0/gems/sass-3.4.6/bin" ":" (getenv "PATH") ) )

  1. And because I use "compass" also, I add below compile options to make sure everything is fine when C-x C-s is clicked.

(setq scss-sass-options '("--compass"))

1
On my macbookAir it was at /usr/bin/localDaX

1 Answers

3
votes

STEP 1:  The original poster should use a search utility to search his entire hard drive for the executable "sass". On Snow Leopard, for example, it installs to /usr/bin, but may not necessarily be in the same place for the original poster.

STEP 2: The original poster should look at line 40 of scss-mode, which can be adjusted to use an absolute path if the original poster would prefer not to fiddle around with the Emacs $PATH -- see https://github.com/antonj/scss-mode/blob/master/scss-mode.el


The following command can be used to see the current $PATH used by Emacs:

M-x eval-expression RET (getenv "PATH") RET

Once the location of "sass" has been located, the original poster can add it to the Emacs path if needed -- e.g.,

(setenv "PATH" (concat (getenv "PATH") ":/path/to/folder-containing-sass"))

See also the instructions on the first page of the sass-mode repository for additional setup ideas:

https://github.com/antonj/scss-mode