3

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?

Makoto
  • 104,088
  • 27
  • 192
  • 230
Ken
  • 626
  • 1
  • 8
  • 22
  • 2
    Your Terminal has [different environment](http://stackoverflow.com/q/135688/104891). If you run PhpStorm like this, it should work: `open -a /Applications/PhpStorm.app/`. Or you can specify the same environment directly in the File Watcher settings (most likely `PATH` matters). – CrazyCoder Aug 13 '13 at 00:30
  • Using open -a fixed the issue! Where in the settings can I edit the PATH? I haven't been able to locate it. – Ken Aug 13 '13 at 00:59
  • 2
    See **Environment Variables** on your screenshot. – CrazyCoder Aug 13 '13 at 02:03
  • Thanks again! You should post your answer below so I can give you credit for it. – Ken Aug 13 '13 at 12:37

1 Answers1

5

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.
Community
  • 1
  • 1
CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
  • 2
    specifically you'll want to head to your prompt and `$ echo $PATH` copy that output, then head to PhpStorm's File Watcher config and click the `…` button by Environment Variables. On the next screen you'll see an empty list; click the `+` button and name your variable "PATH" (no "$") then paste what you just echo'd into the value field – Mark Fox Oct 20 '13 at 02:46
  • @MarkFox Thank you! That worked for PhpStorm 2018.1 on Linux Mint 18.3 – xDaizu May 03 '18 at 08:42