简体   繁体   中英

Error on bootstrap gem

I've been getting the following error after trying to install the bootstrap gem. I've followed the advice found elsewhere but it doesn't seem to be working. I definitely always remember to restart my server after bundle install but I'm still having trouble.

Showing /home/ubuntu/workspace/sample_app/app/views/static_pages/home.html.erb where line #13 raised:

File to import not found or unreadable: bootstrap-sprockets.

Gemfile:

    source 'https://rubygems.org'

    gem 'rails',          '5.0.0'
    gem 'bootstrap-sass', '3.3.6'
    gem 'puma',           '3.4.0'
    gem 'uglifier',       '3.0.0'
    gem 'coffee-rails',   '4.2.1'
    gem 'jquery-rails',   '4.1.1'
    gem 'turbolinks',     '5.0.0'
    gem 'jbuilder',       '2.4.1'

    group :development, :test do
      gem 'sqlite3', '1.3.11'
      gem 'byebug',  '9.0.0', platform: :mri
    end

    group :development do
      gem 'web-console',           '3.1.1'
      gem 'listen',                '3.0.8'
      gem 'spring',                '1.7.2'
      gem 'spring-watcher-listen', '2.0.0'
    end

    group :test do
      gem 'rails-controller-testing', '0.1.1'
      gem 'minitest-reporters',       '1.1.9'
      gem 'guard',                    '2.13.0'
      gem 'guard-minitest',           '2.4.4'
    end

    group :production do
      gem 'pg', '0.18.4'
    end

    # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
    gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

aplication.css.scss

    *...
    * It is generally better to create a new file per style scope.
     *
     */
    @import "bootstrap-sprockets";
    @import "bootstrap";

application.js

    //= require jquery
    //= require jquery_ujs
    //= require turbolinks
    //= require_tree .

Thanks for any help!

Add the to the Gemfile the gem sass-rails :

gem 'bootstrap-sass', '~> 3.3.6'
gem 'sass-rails', '>= 3.2'

Check the docs at https://github.com/twbs/bootstrap-sass#a-ruby-on-rails

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