Search code examples
rubyresponsive-designsassbundlercompass-sass

Grunt/Bundler wont use specified sass version


We have a project with Grunt and Bundler setup. All of these installed without issue. Gemfile.lock generated, proper gems pulled down, and grunt files created with npm. We start our watch on the project and it bombs on sass compile because it's using the wrong version of sass and not the one specified in the gemfile.

This is on windows by the way...

Gemfile

source 'https://rubygems.org'

gem 'sass', '~> 3.2'
gem 'compass', '~> 0.12'
gem 'susy', '~> 1.0'

Gemfile.lock

GEM
  remote: https://rubygems.org/
  specs:
    chunky_png (1.3.1)
    compass (0.12.6)
      chunky_png (~> 1.2)
      fssm (>= 0.2.7)
      sass (~> 3.2.19)
    fssm (0.2.10)
    sass (3.2.19)
    susy (1.0.9)
      compass (>= 0.12.2)
      sass (>= 3.2.0)

PLATFORMS
  x86-mingw32

DEPENDENCIES
  compass (~> 0.12)
  sass (~> 3.2)
  susy (~> 1.0)

Solution

  • If you want to limit your gems to only those in your bundle (listed in your Gemfile), you should prefix your commands with bundle exec when running them in the terminal.

    eg. if you were running sass --watch then you would run bundle exec sass --watch to make sure you use the version in your bundle.

    Documentation on bundle exec: http://bundler.io/man/bundle-exec.1.html