I am suddenly getting this error in development and in production on deployment.
custom.css.scss
@import \"bootstrap-sprockets\";
@import \"bootstrap
Make sure you don't have
gem 'bootstrap' # Remove this line
gem 'bootstrap-sass'
It should just be
gem 'bootstrap-sass'
I was also facing the similar error in development environment:
Error Image
I solved this problem by-
In my gemfile, I added them -
gem 'bootstrap', '~> 4.2.1'
gem 'jquery-rails'
In application.js file,add these -
//= require jquery3
//= require popper
//= require bootstrap-sprockets
In the file with .scss extension, simply add -
@import "bootstrap";
After that, just run bundle install
If you get this message when running integration tests, make sure that your asset gems are included in the test group.
For example, change:
group :assets do
gem 'sass-rails', '~> 5.0.3'
gem 'uglifier', '>= 1.3.0'
end
To:
group :assets, :test do
gem 'sass-rails', '~> 5.0.3'
gem 'uglifier', '>= 1.3.0'
end
make sure you run the following commands after adding this gem to your Gemfile put this inside your Gemfile
gem "bootstrap-sprockets", "~>3.3"
gem "bootstrap"
now stop your server and run the following:
bundle install
rails server
to restart your server. Refresh your browser and you should see changes reflect immediately. In production you may have to run this command to precompile your assets:
bundle exec bin/rake assets:precompile
It worked for me. Hope this was helpful.
I solved it in following steps:
I had the same problem
sass::syntaxerror: file to import not found or unreadable: config/variables.
, I opened a new css file (I called it custom.css) then copied all the css to the file. On application.css I removed the
@import "config/variables" plus all the other @imports
This worked for me, I hope it does work for you too!