Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
831 views
in Technique[技术] by (71.8m points)

ruby - Error using PHPStorm's SASS File Watcher

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

Output:

overwrite style.css

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:

enter image description here

Any ideas?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

Workarounds:

  • Run the IDE from Terminal: open -a /Applications/PhpStorm.app/
  • Edit Environment Variables directly in the File Watcher configuration.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...