I’m trying to install the bootstrap-sass gem on my Rails 3.2 app, but encounter this error when I call compass install bootstrap :
No such framework: “bootstrap”
I have the gem installed in my Gemfile:
gem 'compass', '~> 0.12.2'
group :assets do
...
gem 'sass-rails', '~> 3.2.4'
gem 'compass-rails', '~> 1.0.3'
gem 'bootstrap-sass', '~> 2.1.1.0'
end
I’ve put in the import statement to my application.css.scss file:
@import "bootstrap";
I’ve required bootstrap in my application.js:
//= require jquery
//= require jquery_ujs
//= require bootstrap
...
and I’ve required bootstrap-sass in my config.ru file:
require 'bootstrap-sass'
require ::File.expand_path('../config/environment', __FILE__)
run MYAPP::Application
Anyone have any idea what the problem could be, or encountered the same problem?
Here’s the git for bootstrap-sass: https://github.com/thomas-mcdonald/bootstrap-sass.git
Figured it out…
So to get the install to work, I had to call
bundle exec compass install bootstrap. This executescompass install bootstrapin the context of the bundle, which includes all the gems. However, this gave rise to some more problems.The install wrote several new bootstrap javascript files to my assets/javascripts directory. In Rails 3.2, these are automatically loaded by the asset pipeline, but in the wrong order, so in my browser console, I was getting error messages for a missing constructor and calling ‘popover’ on an undefined object. After digging around, the solution was just to delete all the newly generated javascript files, as they are already included by having
//= require bootstrapin application.js.