简体   繁体   中英

bootstrap-sass gem breaking my rails 3.2.3 at step 5.1.2 in Hartl's rails tutorial

Everything up to this point has worked great, including upload to github and heroku, as well as using postgres for dev/test and prod/heroku.

As soon as I add

gem 'bootstrap-sass', '2.0.0'

to my Gemfile and run bundle install (or bundle install --without assets ), spork, guard, and rails (and stand-alone passenger) all complain w/ the following:

/var/lib/rails/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:74:in `require': cannot load such file -- bootstrap/sass (LoadError)
    from /var/lib/rails/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:74:in `rescue in block in require'
    from /var/lib/rails/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:62:in `block in require'
    from /var/lib/rails/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:55:in `each'
    from /var/lib/rails/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:55:in `require'
    from /var/lib/rails/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler.rb:119:in `require'
    from /var/lib/rails/sample_app/config/application.rb:13:in `<top (required)>'
    from /var/lib/rails/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/commands.rb:53:in `require'
    from /var/lib/rails/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/commands.rb:53:in `block in <top (required)>'
    from /var/lib/rails/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/commands.rb:50:in `tap'
    from /var/lib/rails/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

here's my Gemfile and the relevant part of Gemfile.lock:

source 'https://rubygems.org'

gem 'rails', '3.2.3'
gem 'jquery-rails', '2.0.0'
gem 'bootstrap-sass', '2.0.0'
gem 'bcrypt-ruby', '3.0.1'
#gem 'faker', '1.0.1'
#gem 'will_paginate', '3.0.3'
#gem 'bootstrap-will_paginate', '0.0.5'

group :development, :test do
  #gem 'sqlite3', '1.3.5'
  gem 'rspec-rails', '2.9.0'
  gem 'guard-rspec', '0.5.5'
end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '3.2.4'
  gem 'coffee-rails', '3.2.2'
  gem 'uglifier', '1.2.3'
end

group :test do
  gem 'capybara', '1.1.2'
  #gem 'factory_girl_rails', '1.4.0'
  #gem 'cucumber-rails', '1.2.1', require: false
  #gem 'database_cleaner', '0.7.0'
  gem 'guard-spork', '0.3.2'
        gem 'spork', '0.9.0'
        # gem 'rb-fsevent', '0.4.3.1', require: false
        # gem 'growl', '1.0.3'
end

#group :production do
  gem 'pg', '0.12.2'
#end

$ egrep "bootstrap|sass" Gemfile.lock

bootstrap-sass (2.0.0)
sass (3.1.17)
sass-rails (3.2.4)
  sass (>= 3.1.10)
bootstrap-sass (= 2.0.0)
sass-rails (= 3.2.4)

the platform is a Gentoo OpenVZ container, using a dedicated, non-privileged 'rails' account.

I've checked my work several times, removed gems and re-bundled, still no love.

try putting bootstrap-sass in the assets group of the Gemfile?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM