本文介绍了使用PHPStorm的SASS File Watcher时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当PHPStorm尝试使用文件监视程序将我的SASS文件转换为CSS时,我都会收到以下错误消息:

I'm getting the following error whenever PHPStorm attempts to convert my SASS file to CSS using the file watchers:

/Users/Ken/.rvm/gems/ruby-2.0.0-p195/bin/sass --no-cache --update style.sass:style.css
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:777:in `report_activate_error': Could not find RubyGem sass (>= 0) (Gem::LoadError)
  from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:211:in `activate'
  from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:1056:in `gem'
  from /Users/Ken/.rvm/gems/ruby-2.0.0-p195/bin/sass:22
  from /Users/Ken/.rvm/gems/ruby-2.0.0-p195/bin/ruby_noexec_wrapper:14

当我在终端中运行命令时,一切都会按预期进行:

When I run the command in the terminal, everything works as expected:

/Users/Ken/.rvm/gems/ruby-2.0.0-p195/bin/sass --no-cache --update style.sass:style.css

输出:

overwrite style.css

我对为什么它抱怨Ruby 1.8版本缺少SASS感到困惑,因为我已经在PHPStorm中编辑了设置以使用Ruby 2.0(通过RVM).这是我的项目设置:

I'm confused as to why it's complaining about Ruby 1.8 version missing SASS as I've edited my settings in PHPStorm to use Ruby 2.0 (via RVM). Here are my project settings:

有什么想法吗?

推荐答案

您在Terminal和PhpStorm中具有不同的PATH环境,它是特定于Mac OS .

You have different PATH environment in Terminal and in PhpStorm, it's Mac OS specific.

解决方法:

  • 从终端:open -a /Applications/PhpStorm.app/
  • 运行IDE直接在File Watcher配置中
  • 编辑环境变量.
  • Run the IDE from Terminal: open -a /Applications/PhpStorm.app/
  • Edit Environment Variables directly in the File Watcher configuration.

这篇关于使用PHPStorm的SASS File Watcher时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 21:10