Sass - Error Installing [duplicate]

2019-04-10 12:38发布

This question already has an answer here:

I had the Ruby gem Sass installed recently and have been frequently using it for an app I'm working on. Today I went to go run sass --watch scss:css as I normally would and noticed I got the following error:

-bash: sass: command not found

I then tried running the following line and got this output:

~$ sudo gem install sass

ERROR:  While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/sass

I would consider myself a novice when it comes to interpreting shell/bash errors, any suggestions as to what might be causing this?

Update

I've since tried @jperelli's suggestion and got the following (ps I am on Mac OS):

~$ sudo gem update bundler

Updating installed gems
Updating bundler
Fetching: bundler-1.10.5.gem (100%)
ERROR:  While executing gem ... (Errno::EPERM)
    Operation not permitted - /usr/bin/bundle

2条回答
做个烂人
2楼-- · 2019-04-10 13:24

If you have still this problem, you may try:

$ sudo gem install -n /usr/local/bin sass

I had almost the same issue (for compass) with the latest update to OS X El Capitan, and it worked for me. Just use it like this:

$ sudo gem install -n /usr/local/bin gem_package_name

Good Luck!

查看更多
姐就是有狂的资本
3楼-- · 2019-04-10 13:30

Maybe you stupmed a bug in bundler itself https://github.com/bundler/bundler/issues/1977

Try upgrading bundler and then installing sass again

sudo gem update bundler
sudo gem install sass

Alternatively, you can install sass from OS repositories

# assuming you use ubuntu
sudo apt-get install ruby-sass
查看更多
登录 后发表回答