ruby sass, unable to resolve dependancies

2019-02-28 16:29发布

问题:

I downloaded two gem files: Sass-3.3.7.gem & compass-0.12.6.gem

I ran gem install --local Sass-3.3.7.gem which it installed.

Followed by the same command for compass, but got the error:

 unable to resolve dependencies: compass requires sass (~>3.2.19)

I'm installing them pre-downloaded as I have no connection. Anyone knows what can be the solution?

回答1:

Compass 0.12.6 apparently depends on sass ~>3.2.19, which means that the version of sass should be bigger than 3.2 and smaller than 3.3, so basically compass needs sass 3.2.x. You have two options.

  1. Also download sass 3.2.19, install both versions of sass, use the latest one yourself and make compass happy.
  2. Just install sass 3.2.19 and use that yourself as well, this obviously only works if you don't need any features introduced in sass 3.3.


回答2:

Install Sass 3.2.19:

sudo gem install sass -v 3.2.19 

I didn't need Sass 3.3.7, and Jekyll keep finding the latest version installed, so I got uninstalled Sass 3.3.7:

sudo gem uninstall sass

Sass doesn't seem to overwrite previous versions, so I still had 3.3.2 installed (if there are multiple versions installed it gives you a choice of what version you'd like to uninstall), so I uninstalled that as well.



回答3:

You can run gem dependency <gem name> to see list of the gem dependencies and required versions.