Trycos79
Trycos79

Reputation: 43

File to import not found or unreadable: bootstrap-sprockets on rails 5.2.0

I have following problem. "File to import not found or unreadable: bootstrap-sprockets."

Following gems I have installed gem 'bootstrap' gem 'bootstrap-sass', '~> 3.3.7' gem 'sass-rails', '>= 3.2'

File: Application name change from css to scss. In the application.scss file I add the lines

@import "bootstrap-sprockets"; @import "bootstrap";

I bundle install and afterwards restart the server. But still the same error message. It will be great if somebody had the same issue and found a solution, all written solutions on stackoverflow doesn't work.

Upvotes: 1

Views: 3805

Answers (1)

ArtLion
ArtLion

Reputation: 43

OK, I worked on topic and the working solution:

  • add 'bootstrap', '~> 4.1.3' to Gemfile and save
  • gem install sprockets-rails in command line of project. Version at least 2.3.2, now 3.2.1 is available
  • bundle install in command line of project
  • rename file application.css to application.scss under /app/assets/stylesheets
  • The only line for bootstrap is @import "bootstrap"; at file application.scss
  • start rails again by rails s in command line of project
  • go to home page with some code for bootstrap 4.1.3 inside.

You can check my code free https://bitbucket.org/ArtLion74/myrecepies commit with name Bootstrap working in chrome and firefox.

Regards, Artur

_______________________ old answer ____________________

it's not RoR problem. You didn't say that you see error in ... Chrome :) I had the same. Check in Firefox and ... surprise - working. Problem is only on Chrome. Strange is that after switching to Chrome - it's start working - without errors but without bootstrap formatting too :( I really don't get it :(

Problem is on www client side Chrome - not in RoR.

Upvotes: 0

Related Questions