AWIA LogoFacebookGoogle Plusicon-codingicon-computericon-designicon-drawicon-drupalicon-maintenanceicon-mapicon-wordpressLinked InTwitter

After running an update to my local gems, I started getting a bunch of warning messages whenever I compiled a Drupal Zurb Foundation subtheme base project.

WARNING: Paremeter $from-context must resolve to a value in pixel units. on line 43 of /Users/derek/.rvm/gems/ruby-2.0.0-p353/gems/compass-core-1.0.1/stylesheets/compass/typography/_units.scss from line 4 of /Users/derek/.rvm/gems/ruby-2.0.0-p353/gems/compass-core-1.0.1/stylesheets/compass/_typography.scss from line 2 of /Users/derek/.rvm/gems/ruby-2.0.0-p353/gems/compass-core-1.0.1/stylesheets/_compass.scss from line 17 of /Users/derek/Sites/client/sites/all/themes/midas/scss/base/_init.scss from line 33 of /Users/derek/Sites/client/sites/all/themes/midas/scss/custom.scss

The error mesage is annoying but doesn't seem to cause any major issues. My code is valid SASS and it still generates valid CSS. I'm not keen on warning messages popping up.

There are 2 approaches you can take. You can mute the messages. That will get rid of the warnings but not the cause.

How to mute

In your project directory, open your config.rb file and insert the line "disable_warnings = true".

Fixing the cause

Since it happened after I updated my gems, then the logical cause is an updated gem conflicts with my version of zurb foundation. Usually runinning a "bundle install" command will fix things it will download the appropriate gems for you project.

This time, bundle didn't help. Time for some investigation. You can eaily check which versions of gems you have by using the command gems list. That will list all the versions you have. One of the things that is useful in a Ruby enviroment, is the ability to have multiple versions of the same packages. This means you can revert back to older packages if there are conflicts.

Zurb Foundation depends on Compass & SASS. Looking at them, I noticed that both had new versions. Compass 1.0.1 from 0.12.2 and SASS 3.4.2 up from 3.2.14

How to revert back to old packages

There should be a file called "Gemfile". This will tell bundler what versions to fetch. Edit your Gemfile to tell it which specific version to download. After experimenting, I found Compass 0.12.6 & SASS 3.2.19 was the combination that made my errors go away. Your mileage may vary.

source "https://rubygems.org" # Replace 4.3.2 with the version of Foundation you want to use gem "zurb-foundation", "4.3.2" #gem "compass" #set Compass and SASS to versions that don't produce errors gem "compass" , "0.12.6" gem "sass", "3.2.19" # gem "guard" # For more information on this file see: # http://foundation.zurb.com/docs/sass.html # http://zslabs.com/articles/versioned-dependencies-with-compass

Once you've updated your file, run "bundle install". You may get some error:

You have requested:
sass = 3.2.19

The bundle currently has sass locked at 3.4.2.
Try running `bundle update sass`

Run the "bundle update sass" command as advised and that should fix it.

Try compass compile again and the warning messages should be gone.

Categories

Posts

All posts