I am relatively new to programming, therefore I hope that the question is not absolutely stupid.
I got a problem concerning my rails app.
I try to use bootstrap.
I got the same problem of "File to import not found or unreadable: bootstrap" in my scss file. I just solved by adding require statement of "bootstrap-sass" to config.ru file. My config.ru is like the following.
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
require 'bootstrap-sass' #require statement of bootstrap-sass
run Rails.application
Had the same issue in a new application, but restarting the development server solved the issue.
facing same problem. I rename custom.css.scss to custom.css and I specified version of ruby in Gemfile. and bundle install . in my case: ruby '2.0.0'
I had a similar issue, and I changed the file type from css to scss. I bet if you erase '.css' from your file name it'll work.
I had this same problem, solved by fixing bootstrap-sass and sass-rails versions to:
gem 'sass-rails', '~> 3.2'
gem 'bootstrap-sass', '~> 2.3.1.0'
And then bundle install
and server restart.
I had a similar issue when working on a Rails 6 application with Bootstrap 4.
The issue was that I did not specify the node modules full path of the bootstrap.scss
file in my app/assets/stylesheets/application.scss
file.
After installing Bootstrap 4 and its dependencies using this command:
yarn add bootstrap jquery popper.js
All I needed to do was to modify it from:
@import "bootstrap";
to
@import 'bootstrap/scss/bootstrap';
You can then add require the boostrap.js
file in the app/javascript/packs/application.js
file this way:
require("bootstrap");
That's all.
I hope this helps