I was trying to play with Twitter Bootstrap Basics using Rails 4.0.0.rc1 and ruby 1.9.3p392.
Then I try to access
http://localhost:3000/products
I'm having error:
'twitter/bootstrap/bootstrap.less' wasn't found.
Please see attached screenshot.
Code available at https://github.com/tenzan/twitter-bootstrap.git
I'm going to answer this noting that I am working on ruby 2 / rails 4 application (NOT rails 3)
Requiring Bootstrap LESS (bootstrap_and_overrides.css.less) in your application.css is meaningless here, because the pipeline comes already with "require_tree ." which automatically includes everything inside the folders of the asset pipeline.
After pulling my hair for several hours, I found that removing the 3 required gems from the group :asset in the Gemfile is the only way to fix it
So, Do Not do this in you Gemfile:
group :assets do
gem "therubyracer"
gem "less-rails"
gem "twitter-bootstrap-rails"
end
And instead DO this:
gem "therubyracer"
gem "less-rails"
gem "twitter-bootstrap-rails"
The Bootstrap gem comes with it's own bundled version of Bootstrap which it will take responsibility for importing. Don't import the Bootstrap gem in the :assets group, or the gem assets won't be found.
Note that the assets group has been removed in Rails 4.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With