Search code examples
rubyrubygemssasszurb-foundationcompass

How to resolve gemfile sass dependency issue


I'm having a hell of a time making my install of Foundation / SASS / Compass work and I think I might have a dependency issue. I tried to run 'compass init' and this is outputted in my CLI:

C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/depend 
in `to_specs': Could not find sass (< 3.5, >= 3.3.13) 

(Gem::LoadError) 
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/ru 
fication.rb:778:in block in activate_dependencies' 
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/ru 
fication.rb:767:ineach' 
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/ru 
fication.rb:767:in activate_dependencies' 
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/ru 
fication.rb:751:inactivate' 
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/ru 
32:in gem' 
from C:/RailsInstaller/Ruby1.9.3/bin/compass:22:in'

Solution

  • From your comment it seems like your app does not have a Gemfile and therefore bundler cannot solve the dependency betweens different Gems for you. I see two options:

    • Install the missing sass Gem manually with gem install sass -v '3.4.6'. If an other versions of the sass Gem is alreday installed, uninstall it first with gem uninstall sass (might break other apps) and than install the needed version: gem install sass -v '3.4.6'. And hope that there are no other Gems missing.

    Or:

    • Start using Bundler (see: http://bundler.io/gemfile.html). That means: create a Gemfile and add all Gems that your app needs into that file. That might be more work at the beginning, but is IMO the better option if you plan to maintain the app for a longer period of time.