ruby sass, unable to resolve dependancies - ruby

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?

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.
Also download sass 3.2.19, install both versions of sass, use the latest one yourself and make compass happy.
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.

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.

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

Related

CodeKit: Sass/Compass Conflicts

I get this error when I try to compile using Compass on Codekit:
Compass failed to run because your Mac has an older version of Sass
and/or Compass installed that conflicts with the newer versions in
CodeKit. You must remove all versions of Sass below 3.3.rc6 and all
versions of Compass below 1.0.alpha18. Do this at the command line by
running 'sudo gem uninstall sass' and 'sudo gem uninstall compass'.
I ran sudo gem uninstall sass and sudo gem uninstall compass, however when I try to compile through CodeKit again I get the same error.
try running gem query --local this will list local gems, once you have a list, just go through and remove all sass+compass related gems with sudo gem uninstall ___, pretty sure that compass also has compass-core, but there are probably more
How have you initially installed your gems? Is it possible that you've also installed gems with just gem install? Cuz sudo gem installs gems as root for all users while gem install only installs gems for your active user. So maybe gems left installed which aren't uninstalled with sudo gem uninstall?
On the other hand why uninstall compass at all. I am running Codekit 2.1 with its internal Sass 3.3.10 along with the external gem Compass 0.12.4. That actually works quite well. You have go to Codekit Preferences -> Other Tools -> Compassand choose the radio button "Use the Compass executable at this path" and select your Compass gem then.
If you are using RVM for your ruby management then switch to your system ruby version
rvm use system
and install sass and compass for this version
sudo gem install sass
sudo gem install compass
This worked for me!

Can I install Compass with an old version of SASS?

When installing Compass (on Linux command line), can I specify which old version of SASS will be installed with it?
You can install a specific version of SASS using the following command:
gem install sass -v 3.3.4
Replace 3.3.4 with the preferred version.
You can find a list with all versions of SASS at RubyGems

Sass syntax error: Invalid CSS after [duplicate]

I have just upgraded to Sass 3.3 so that I can use some of the new features (BEM styled class names, mappings, #at-root, etc). If I compile my project with Sass (via sass --watch), it works just fine. However, if I compile it using Compass (via compass watch), I get an error when using the new Sass features.
I'm using Compass 0.12.
Compass 0.12 explicitly depends on Sass 3.2. Even if you have a newer version of Sass installed, it will still compile with 3.2. In order to use Sass 3.3 or later, you have to be using Compass 1.0 or later.
Running the gem install command normally should get you the latest stable version.
gem install compass
At the time this question was asked, Compass 1.0 was still in beta. To install the latest beta version of a gem, you will need to install it using the --pre flag.
gem install compass --pre
Note that you do not need to install Sass first in order for this to work. Installing Compass will automatically install the latest version of Sass that it is compatible with.
I have Compass 1.0 installed and it still errors
Double check any other dependencies you might have (Compass extensions, etc.), one of them might be specifying an older version of Sass or Compass.
If you're using an application or build tool rather than using the commands directly, make sure they're not referencing older versions of Compass.
Windows users
As a Window user, I got an error when I tried to watch my project using the newer Compass.
LoadError on line ["36"] of C: cannot load such file -- wdm"
To fix that problem:
You must install the ruby DevKit:
Download found here: http://rubyinstaller.org/downloads/
Follow this page to properly install:
https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
Now install wdm:
gem install wdm
There didn't seem to be any one place that contained the whole list of steps required, in order, to make this work, so here they are. This list is for Windows, but it may work fine on other platforms.
Install Ruby -- use 1.9.3 -- http://rubyinstaller.org/downloads .
Download the Ruby DevKit found lower on the same page -- http://rubyinstaller.org/downloads/
run it to extract it somewhere (permanent). Then cd to it, run “ruby dk.rb init” and “ruby dk.rb install” to bind it to ruby installations in your path.
gem install wdm
gem install sass
gem install compass --pre
It now is, in the latest version of Compass. Update compass to get the changes and work with Sass 3.3 and higher
Current Sass compatibility can be found here: https://rubygems.org/gems/compass
To upgrade just run
$gem install compass

Can't get sass + compass + susy installed due to version conflict

I'm working with Sass, Compass and Susy on OSX / Terminal. But I can't get Susy to work together with Sass and Compass. What I've done:
sudo gem install sass
sass -v
Returns: Sass 3.3.0 (Maptastic Maple)
sudo gem install compass
This seems to also install sass-3.2.14.gem, then the compass-0.12.3.gem.
compass -v
returns: Compass 0.12.3 (Alnilam)
Everything until this point seems to work fine; I can create a Compass project and work with it. Then I try to install Susy:
sudo gem install susy --pre
or just
sudo gem install susy
This seems to install susy-2.0.0
Than I run:
compass create /Users/tom/Thomas/htdocs/susi4-test -r susy -u susy
And I get this error:
Gem::LoadError on line 2064 of /Library/Ruby/Site/1.8/rubygems/specification.rb: Unable to activate susy-2.0.0, because sass-3.2.14 conflicts with sass (~> 3.3.0)
Run with --trace to see the full backtrace
So there seems to be a problem with the compatibility of the different versions. What can I do to resolve this error?
The dependencies are incompatible: susy 2.0.0 depends on sass ~> 3.3.0 whereas compass 0.12.3 depends on sass = 3.2.14.
The error message says the same:
Unable to activate susy-2.0.0, because sass-3.2.14 conflicts with sass (~> 3.3.0)
You can a) downgrade susy to a version that's working with sass 3.2.14 or b) upgrade compass to a version compatible with sass 3.3.x.
A compatible version is compass 1.0.0 (or later) depending on sass < 3.5, >= 3.3.13. You can install it via
gem update compass
It might be easier to use a gem manager like Bundler. It automatically resolves dependencies and installs the appropriate versions.
gem install compass --pre
when you install compass lastest version will have error like:
ERROR: While executing gem ... (Gem::UnsatisfiableDependencyError)
Unable to resolve dependency: 'compass (= 1.0.0.alpha.19)' requires 'compass-core (~> 1.0.0.alpha.19)'
You should install compass-core first
gem install compass-core
The best way without a doubt is to install Susy via the Compass Susy Plugin. This will avoid conflicts with other Compass projects that require the current version.
Commands:
gem install compass
gem install compass-susy-plugin

How to switch compass version?

I have two versions of Compass, 0.12 and 0.13.alpha. The default version is 0.13.alpha but sometimes I need to switch to 0.12.
What command will permit this, please?
old topic, but I just came across the issue of having 2 projects. one using compass version 0.12 and the other 1.0.
as the newer version of compass relies on a new major release of sass, many deprecation warnings and compatibility issues are experienced when trying to run the newer compass on the old project.
well, now to the solution:
ruby gems already support having multiple versions installed. and after taking a look into the compass executable, it turns out there is a way to specify which compass version to use (the file is generated by rubygems, see http://pastebin.com/HeZnE0T5 if you are curious)
with that we can now have multiple versions of compass installed at once. eg:
gem install compass -pre // currently version 1.0.0.alpha.19
gem install compass // currently version 0.12.6
and now we can use them by specifying which version to use:
$ compass version
Compass 1.0.0.alpha.19
Copyright (c) 2008-2014 Chris Eppstein
Released under the MIT License.
Compass is charityware.
Please make a tax deductable donation for a worthy cause: http://umdf.org/compass
$ compass _0.12.6_ version
Compass 0.12.6 (Alnilam)
Copyright (c) 2008-2014 Chris Eppstein
Released under the MIT License.
Compass is charityware.
Please make a tax deductable donation for a worthy cause: http://umdf.org/compass
this obviously also works for other compass commands, eg watch:
$ compass _0.12.6_ watch .
>>> Compass is watching for changes. Press Ctrl-C to Stop.
EDIT: of course the version switch can be done in a Gemfile, but in my case its not a ruby project and compass is started via command line
If you are switching versions for different projects, I recommend using either RVM (Ruby) or virtualenv with some help (Python) or something similar to manage gems and versions. Bundler will help make either solution simpler to maintain.
If you are switching versions within a project, I recommend reconsidering your approach.
This is really simple using bundler.
Install bundler:
$ gem install bundler
Create the Gemfile in your project if you don't already have one:
$ bundle init
Specify the version you want/need in your Gemfile:
gem 'compass', '~>0.12.2'
gem 'sass', '3.2.8'
Install the specific gems and dependencies you have defined in your Gemfile:
$ bundle install
When executing a gem, you can now use bundler to control which version to execute based on your Gemfile:
$ bundle exec compass watch
That's it!
It's helpful to leave a comment in your Gemfile telling other developers how to use bundler:
# Now that you're using Bundler, you need to run `bundle exec compass watch` instead of simply `compass watch`.
Read more about versioning at http://bundler.io/v1.6/gemfile.html
Change the gemfile, add in a version parameter.

Resources