我試圖在我的應用程序中實現引導程序,並且在開始應用程序之前,我一直收到一些我從未收到的錯誤。我瀏覽了一個答案,我一直髮現的唯一答案是刪除我沒有的Gemfile的assets
部分,並重新啓動服務器,我已經做了好幾次沒有運氣。以下是錯誤和我的文件。請讓我知道是否需要提供其他內容。謝謝!Bootstrap-Sprockets錯誤:要導入的文件未找到或無法讀取:引導程序鏈輪
瀏覽器錯誤: File to import not found or unreadable: bootstrap-sprockets
Rails的服務器警告:
/Users/tucker/.rvm/gems/ruby-2.2.1/gems/bootstrap-sass-3.3.6/lib/bootstrap-sass/version.rb:2: warning: already initialized constant Bootstrap::VERSION
/Users/tucker/.rvm/gems/ruby-2.2.1/gems/bootstrap-4.0.0.alpha3/lib/bootstrap/version.rb:2: warning: previous definition of VERSION was here
/Users/tucker/.rvm/gems/ruby-2.2.1/gems/bootstrap-sass-3.3.6/lib/bootstrap-sass/version.rb:3: warning: already initialized constant Bootstrap::BOOTSTRAP_SHA
/Users/tucker/.rvm/gems/ruby-2.2.1/gems/bootstrap-4.0.0.alpha3/lib/bootstrap/version.rb:3: warning: previous definition of BOOTSTRAP_SHA was here
的Gemfile:
source 'https://rubygems.org'
gem 'rails', '4.2.5'
group :production do
gem 'pg'
gem 'rails_12factor'
end
group :development do
gem 'sqlite3'
end
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'bootstrap'
gem 'figaro'
gem 'pry'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'bootstrap-sass'
group :development, :test do
gem 'byebug'
gem 'web-console', '~> 2.0'
gem 'spring'
gem 'rspec-rails'
gem 'shoulda'
gem 'faker'
gem 'factory_girl_rails'
end
application.js中:
//= require jquery
//= require bootstrap-sprockets
//= require jquery_ujs
//= require turbolinks
//= require_tree .
Application.scss:
...
*= require_tree .
*= require_self
*/
@import "bootstrap-sprockets";
@import "bootstrap";
嘗試從這個文件'application.scss'刪除所有留言,只留下兩行'@ import' – psantos
謝謝psantos!我只是做了這些改變,並沒有奏效。我編輯了我原來的帖子。我忘記了包含在rails服務器中彈出的其他錯誤,以幫助理解這個問題。 – Tucker
請參閱@ Beniamin的答案。你不需要'bootstrap'寶石,只需''bootstrap-sass' – psantos