问题
I updated to High Sierra earlier this week and am having trouble running compass. When trying to run compass watch it gives me this error:
compass watch
-bash: /usr/local/bin/compass: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby: bad interpreter: No such file or directory
- Tried to update ruby and failed. I have version 2.3. I don't have version 2.0 thats its looking for. so tried to change the path, failed again.
- Also tried to update/reinstall compass.
- I get an error saying I don't have permission to make changes.
回答1:
I had the same problem. Solved it by running:
$ sudo gem uninstall compass
$ gem update --system
$ sudo gem install compass
Hope it works for you!
UPDATE:
From ewartx: https://github.com/Compass/compass/issues/2129
\curl -sSL https://get.rvm.io | bash -s stable
rvm install 2.0.0
gem install compass
回答2:
If you don't want to revert, this worked for me (slightly modified from an answer here https://github.com/oklai/koala/issues/679)
- Open Terminal
- Install Homebrew: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Do not close Terminal, open Mac Appstore and check Update, install all XCode Command Line Tools updates OR in my case, XCode Command Line Tools started install automaticly throught Terminal right after step 2.
- Back to Terminal
- Install Ruby: brew install rbenv ruby-build
At this point, install Compass (instead of SASS in original answer)
- Install Compass gem: sudo gem install -n /usr/local/bin compass
回答3:
I just ran into this as well. The solution was to make sure that the xCode command line tools were installed.
Run the following to install the needed development files.
xcode-select --install
Per @Adi's solution run this to uninstall compass and reinstall it.
sudo gem uninstall compass
gem update --system
sudo gem install compass
After that is complete you should be able to use compass and can re-run your command.
来源:https://stackoverflow.com/questions/46475101/updated-to-high-sierra-and-having-trouble-running-compass