Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'twitter/bootstrap/bootstrap.less' wasn't found

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

enter image description here

like image 616
Askar Avatar asked May 21 '13 08:05

Askar


2 Answers

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"
like image 109
Aghyad Avatar answered Oct 11 '22 03:10

Aghyad


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.

like image 35
superluminary Avatar answered Oct 11 '22 03:10

superluminary