Search code examples
ruby-on-railstwitter-bootstraprubygemsthin

Problems loading bootstrap-sass when starting thin server, rails


I am trying lauch my thin server. This does not work, failing with the following error:

myApp/gems/bootstrap-sass-2.1.0.0/lib/bootstrap-sass.rb:18:in `load!': 
bootstrap-sass requires either Rails > 3.1 or Compass, neither of which 
are loaded (Bootstrap::FrameworkNotFound)
from /Users/MyName/.rvm/gems/ruby-1.9.3-p194@myApp/gems/bootstrap-sass-2.1.0.0/lib/bootstrap-sass.rb:43:in `<top (required)>'
*a bounch of more lines indicating code lines*

I have tried to use the gem 'compass' in stead of 'compass-rails'. That had no result. I have tried to have it outside of my :assets group, no luck. What is goning on here?

I am not able to find any information on this. My gemfile look like this:

source 'https://rubygems.org'

gem 'rails', '3.2.8'
gem 'pg', '0.12.2'

group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'compass-rails'
  gem "bootstrap-sass", ">= 2.1.0.0"
  gem 'uglifier', '>= 1.0.3'
end

group :test do
  gem 'shoulda'
  gem 'mocha'
end

gem 'jquery-rails'
gem "thin", ">= 1.4.1"
gem "rspec-rails", ">= 2.11.0", :group => [:development, :test]
gem "capybara", ">= 1.1.2", :group => :test
gem "email_spec", ">= 1.2.1", :group => :test
gem "cucumber-rails", ">= 1.3.0", :group => :test, :require => false
gem "database_cleaner", ">= 0.8.0", :group => :test
gem "launchy", ">= 2.1.2", :group => :test
gem "factory_girl_rails", ">= 4.0.0", :group => [:development, :test]

gem "devise", ">= 2.1.2"
gem "cancan", ">= 1.6.8"
gem "rolify", ">= 3.2.0"
gem 'faker', '1.0.1'
gem 'will_paginate', '3.0.3'
gem 'paperclip', '~> 3.0'
gem 'ayah_integration'
gem 'rails_autolink'

Solution

  • So, I figured out the problem. It is quite silly.. So:

    In my config.ru file, I had the following:

    ...
    require 'bootstrap-sass'
    require ::File.expand_path('../config/environment',  __FILE__)
    ...
    

    it should have been the other way around:

    ...
    require ::File.expand_path('../config/environment',  __FILE__)
    require 'bootstrap-sass'
    ...