-1

我为 Sublime Text 2 创建了这个构建系统来运行我的 Grunt 项目:

{

"cmd": ["grunt"] ,  
"selector": ["source.js", "source.less", "source.json"] ,
"working_dir": "${project_path}/MyProject" ,
"path": "/Users/me/.nvm/v0.10.0/bin",
"shell": true

}

每次我尝试构建时,都会收到此错误:

Warning: You need to have Ruby and Sass installed and in your PATH for
this task to work. More info:

尽管我已经安装了RubySass,并且两者都在终端中可用。另外,我试过"echo $PATH"了,看起来还可以...

/Library/Frameworks/Python.framework/Versions/2.7/bin:/Users/me/.venvburrito/bin:/Users/me/.nvm/v0.8.22/bin:/opt/local/bin:/opt/local /sbin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Users/me/.rvm/gems/ruby-2.0.0-p0 /bin:/Users/me/.rvm/gems/ruby-2.0.0-p0@global/bin:/Users/me/.rvm/rubies/ruby-2.0.0-p0/bin:/Users/me/ .rvm/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin: /usr/local/bin:/usr/X11/bin:/usr/local/git/bin

为什么 sublime 似乎无法访问我的环境变量?

4

2 回答 2

1

"path"属性将覆盖现有路径。您需要删除该属性或手动添加到 Sass 二进制文件的路径。您可以使用which sass.

例子:

"path": "/usr/local/bin/:/Users/me/.nvm/v0.10.0/bin"

于 2013-03-12T20:18:07.280 回答
0

得到它的工作。我不得不将此添加到“路径”属性中:

"/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/me/.rvm/rubies/ruby-2.0.0-p0/bin/ruby:/Users/me/.rvm/gems/ruby-2.0.0-p0/bin/sass:/Users/me/.nvm/v0.10.0/bin"

显然你必须用你自己的名字替换“我”。感谢 Sindre Sorhus 为我指明了正确的方向。

于 2013-03-12T23:39:22.200 回答