2016-08-06 45 views
1

嘗試安裝引導寶石後,我收到以下錯誤。我遵循了在其他地方找到的建議,但似乎並沒有奏效。我確實總是記得在安裝捆綁軟件後重新啓動我的服務器,但我仍然遇到麻煩。要導入未發現引導寶石上的錯誤

文件或不可讀:

顯示/home/ubuntu/workspace/sample_app/app/views/static_pages/home.html.erb其中線#13提出引導鏈輪。

的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 . 

感謝您的幫助!

+0

您需要添加'// =在需要引導,sprockets'你的'application.js'看docs here:https://github.com/twbs/bootstrap-sass – mrvncaragay

+0

我試過這種方法並重新啓動服務器。現在我得到這個錯誤:無法找到類型爲'application/javascript'的文件'bootstrap-sprockets' –

回答

0

添加到Gemfile中的寶石sass-rails

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

檢查文檔在https://github.com/twbs/bootstrap-sass#a-ruby-on-rails

+0

我試過這種方法並重新啓動服務器。現在我得到這個錯誤:找不到類型爲'application/javascript'的文件'bootstrap-sprockets' –

+0

看起來你缺少sass-rails,我更新了答案 – neydroid

+0

我添加了一個不同的答案。仍然沒有去。 –