简体   繁体   中英

Rails 4 + bower-rails gem + bower + bootstrap sass

I have installed bower-rails gem

then in bower file I included bootstrap-sass, it installed bootstrap-sass in vendor/assets/bower_components.

Now according to a resource bower-rails automatically takes care of adding bower_components to assets, so I am trying this in application.css

 *= require_tree .
 *= require_self
 *= require 'bootstrap-sass'
 */

But it throws me error that bootstrap-sass file not found.

Do I have to manually add vendor/assets/bower_components to assets?

I am pretty new to rails so some explanation would help a lot.

I am following this resource

EDIT: On doing rails c and printing Rails.application.config.assets.paths I can see vendor/assets/bower_components in asset paths `

Finally I resolved the issue by removing all the bower components and running

rails g bower_rails:initialize

It created an intializer for assets bower_rails.rb, which finally solved the problem

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