Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing bootstrap sass with compass

I'm trying to install bootstrap-sass and getting the error below. I've tried an older version of sass but bundler keeps installing 3.3.0.

WARN: Unresolved specs during Gem::Specification.reset:
sass (~> 3.2)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
/Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches/browser_support.rb:1:in require': cannot load such file -- sass/script/node (LoadError)
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches/browser_support.rb:1:in'
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:2:in require'
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:2:inblock in '
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in each'
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in'
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass/sass_extensions.rb:9:in require'
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass/sass_extensions.rb:9:in'
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass.rb:5:in require'
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass.rb:5:inblock in '
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass.rb:4:in each'
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass.rb:4:in'
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/bin/compass:20:in require'
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/bin/compass:20:inblock in '
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/bin/compass:8:in fallback_load_path'
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/bin/compass:19:in'
from /usr/bin/compass:23:in load'
from /usr/bin/compass:23:in'

My Ruby Version - ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]

My Gemfile

source "https://rubygems.org"

gemspec

platform :rbx do
  gem 'rubysl', '~> 2.0'
  gem 'json', '>= 1.8.1'
  gem 'rubysl-test-unit', '~> 2.0'
  gem 'racc'
end

My Gemspec

lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'bootstrap-sass/version'

Gem::Specification.new do |s|
  s.name     = "bootstrap-sass"
  s.version  = Bootstrap::VERSION
  s.authors  = ["Thomas McDonald"]
  s.email    = '[email protected]'
  s.summary  = "Twitter's Bootstrap, converted to Sass and ready to drop into Rails or Compass"
  s.homepage = "https://github.com/twbs/bootstrap-sass"
  s.license  = 'MIT'

  s.add_development_dependency 'compass'
  s.add_development_dependency 'term-ansicolor'
  s.add_development_dependency 'sass-rails', '>= 3.2'
  s.add_runtime_dependency 'sass', '~> 3.3.0'

  s.add_development_dependency 'capybara'
  s.add_development_dependency 'poltergeist'
  s.add_development_dependency 'tzinfo'
  s.add_development_dependency 'jquery-rails'
  s.add_development_dependency 'slim-rails'
  s.add_development_dependency 'uglifier'

  s.files      = `git ls-files`.split("\n")
  s.test_files = `git ls-files -- test/*`.split("\n")
end
like image 766
jhodgson4 Avatar asked Mar 11 '14 10:03

jhodgson4


2 Answers

If you actually have the bootstrap-sass code checked out, change this line in the .gemspec:

s.add_runtime_dependency 'sass', '~> 3.3.0'

to

s.add_runtime_dependency 'sass', '~> 3.2.0'

After this, run bundle update sass, then bundle clean --force. The problem when downgrading the sass gem is that compass still tries to load the newer one, that's why you need the clean (or you could do a gem uninstall if it suits you better).

like image 148
ggPeti Avatar answered Nov 01 '22 18:11

ggPeti


Install the gem

gem install bootstrap-sass

If you have an existing Compass project:

# config.rb:
require 'bootstrap-sass'

bundle exec compass install bootstrap

If you are creating a new Compass project, you can generate it with bootstrap-sass support:

bundle exec compass create my-new-project -r bootstrap-sass --using bootstrap

This will create a new Compass project with the following files in it:

  • _variables.scss - all of bootstrap variables (override them here).
  • styles.scss - main project SCSS file, import variables and bootstrap.

Some bootstrap-sass mixins may conflict with the Compass ones. If this happens, change the import order so that Compass mixins are loaded later.

like image 27
Ashish Chopra Avatar answered Nov 01 '22 19:11

Ashish Chopra