0

I am using rails 5 and for some reason I am getting an error even though I did not change anything. I have tried to change the ending of the filename and changing a gem version number of bootstrap-sass but nothing seems to work.

How can I solve this error?

This is the following error message:

application.scss

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

... 
all the styles

application.css

/*
Error: File to import not found or unreadable: bootstrap-sprockets.
        on line 1 of /home/ubuntu/workspace/kinkyescapes/app/assets/stylesheets/application.scss

1: @import "bootstrap-sprockets";
2: @import "bootstrap";
3: 
4: /*---------------------------- CUSTOM FONTS ----------------------------------*\/
5: 
6: @font-face {

Backtrace:
/home/ubuntu/workspace/kinkyescapes/app/assets/stylesheets/application.scss:1
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/tree/import_node.rb:67:in `rescue in import'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/tree/import_node.rb:45:in `import'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/tree/import_node.rb:28:in `imported_file'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/tree/import_node.rb:37:in `css_import?'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:313:in `visit_import'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/base.rb:36:in `visit'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:160:in `block in visit'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/stack.rb:79:in `block in with_base'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/stack.rb:115:in `with_frame'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/stack.rb:79:in `with_base'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:160:in `visit'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/base.rb:52:in `block in visit_children'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/base.rb:52:in `map'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/base.rb:52:in `visit_children'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:169:in `block in visit_children'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:181:in `with_environment'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:168:in `visit_children'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/base.rb:36:in `block in visit'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:188:in `visit_root'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/base.rb:36:in `visit'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:159:in `visit'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:8:in `visit'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/tree/root_node.rb:36:in `css_tree'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/tree/root_node.rb:29:in `render_with_sourcemap'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/engine.rb:381:in `_render_with_sourcemap'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/engine.rb:298:in `render_with_sourcemap'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/plugin/compiler.rb:492:in `update_stylesheet'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/plugin/compiler.rb:215:in `block in update_stylesheets'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/plugin/compiler.rb:209:in `each'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/plugin/compiler.rb:209:in `update_stylesheets'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/plugin.rb:82:in `update_stylesheets'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/exec/sass_scss.rb:340:in `watch_or_update'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/exec/sass_scss.rb:51:in `process_result'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/exec/base.rb:52:in `parse'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/lib/sass/exec/base.rb:19:in `parse!'
/usr/local/rvm/gems/ruby-2.3.0/gems/sass-3.4.22/bin/scss:13:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.3.0/bin/scss:23:in `load'
/usr/local/rvm/gems/ruby-2.3.0/bin/scss:23:in `<main>'
*/

Gemfile

source 'https://rubygems.org'

gem 'rails', '~> 5.0.0', '>= 5.0.0.1'
gem 'pg'
gem 'bcrypt', '~> 3.1.7'
gem 'jquery-rails'
gem 'coffee-rails', '~> 4.2'
gem 'bootstrap-sass'
gem 'uglifier', '>= 1.3.0'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'

gem 'simple_form'
gem 'devise'

gem 'activeadmin', github: 'activeadmin/activeadmin'
gem 'inherited_resources', github: 'activeadmin/inherited_resources'
gem 'active_skin'
gem 'formtastic', github: 'justinfrench/formtastic'

gem 'omniauth'
gem 'omniauth-facebook'
gem 'omniauth-google-oauth2'

gem 'paperclip'
gem 'aws-sdk'

gem 'geocoder'

gem 'jquery-ui-rails'

gem 'ransack', github: 'activerecord-hackery/ransack'

gem 'will_paginate', github: 'jonatack/will_paginate'
gem 'bootstrap-will_paginate'

group :development, :test do
  gem 'byebug', platform: :mri
end

group :development do
  gem 'web-console'
  gem 'listen', '~> 3.0.5'
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end

group :production do
  gem 'puma'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
trickydiddy
  • 577
  • 6
  • 26
  • 1
    Did you restart the sever after you added the gem and made the imports? – Adetoyese Kola-Balogun Nov 22 '16 at 16:02
  • @BlackEnigma yes I did multiple times – trickydiddy Nov 22 '16 at 16:03
  • 1
    Did you bundle install after making changes to your Gemfile? And I noticed this is your `application.scss` file, did you delete the `manifest comment` or you just didn't paste it? – Adetoyese Kola-Balogun Nov 22 '16 at 16:13
  • @BlackEnigma of course! But for some reason I have now 2 files one is "application.css" and the other one is "application.scss" I am not sure if I had them both from the start. In application css I have the error message which will be rendered on my page. I did not paste it it was automatically created I guess... – trickydiddy Nov 22 '16 at 16:15
  • 1
    Why would you have 2 application stylesheets files? In the [documentation](https://github.com/twbs/bootstrap-rubygem) it clearly says you should have just `application.scss` or else the `application.css` will be served instead. Plus you should also add the `sass-rails` gem to your gem file – Adetoyese Kola-Balogun Nov 22 '16 at 16:22
  • 1
    @BlackEnigma have no idea why I had suddenly two application stylesheets... I deleted the application.css file and it works now! Thank you allot! – trickydiddy Nov 22 '16 at 16:26

1 Answers1

-1

Have you tried the suggestions here: Including this

gem 'bootstrap-sass', '~> 3.3.7'
gem 'sass-rails', '>= 3.2'

in your gemfile, doing a bundle install, and then restarting your server.

And trying the information in the docs In particular where it says:

Then, remove all the *= require_self and *= require_tree . statements from the sass file. Instead, use @import to import Sass files.

Do not use *= require in Sass or your other stylesheets will not be able to access the Bootstrap mixins or variables.

Require Bootstrap Javascripts in app/assets/javascripts/application.js:

//= require jquery
//= require bootstrap-sprockets
bootstrap-sprockets and bootstrap should not both be included in application.js.

bootstrap-sprockets provides individual Bootstrap Javascript files (alert.js or dropdown.js, for example), while bootstrap provides a concatenated file containing all Bootstrap Javascripts.
Community
  • 1
  • 1
Anissa
  • 21
  • 2