1

Have no idea why this is happening. I am following Michael Hartl's online e-book for learning Rails. I am working on another branch called filling-in-layout. I am done working on the branch, and I run rails test and I pass everything. So I checkout master and merge with filling-in-layout.

Only AFTER merging the branches do I find out that rails test FAILS. Makes no sense because I was PASSING on filling-in-layout. Also, filling-in-layout was derived from master.

I've tried bundle install as well as restarting the Rails server rails s -b 0.0.0.0, but even after that, when I run rails test I fail EVERYTHING. All because of bootstrap-sprockets. Here is a copy of the error message:

ERROR["test_should_get_home", StaticPagesControllerTest, 0.941078916999686]
 test_should_get_home#StaticPagesControllerTest (0.94s)
ActionView::Template::Error:         ActionView::Template::Error: File to import not found or unreadable: bootstrap-sprockets.
        Load paths:
          /home/mightu/Desktop/environment/sample_app/app/assets/config
          /home/mightu/Desktop/environment/sample_app/app/assets/images
          /home/mightu/Desktop/environment/sample_app/app/assets/javascripts
          /home/mightu/Desktop/environment/sample_app/app/assets/stylesheets
          /home/mightu/.rvm/gems/ruby-2.6.3/gems/coffee-rails-4.2.2/lib/assets/javascripts
          /home/mightu/.rvm/gems/ruby-2.6.3/gems/actioncable-5.2.3/lib/assets/compiled
          /home/mightu/.rvm/gems/ruby-2.6.3/gems/activestorage-5.2.3/app/assets/javascripts
          /home/mightu/.rvm/gems/ruby-2.6.3/gems/actionview-5.2.3/lib/assets/compiled
          /home/mightu/.rvm/gems/ruby-2.6.3/gems/turbolinks-source-5.2.0/lib/assets/javascripts
          /home/mightu/Desktop/environment/sample_app/node_modules
            app/assets/stylesheets/custom.scss:1
            app/views/static_pages/home.html.erb:13:in `_app_views_static_pages_home_html_erb___1167830118064860930_47459701947860'
            test/controllers/static_pages_controller_test.rb:5:in `block in <class:StaticPagesControllerTest>'

I have also tried this and this, but it does not resolve my issue. I know Rails is complaining about the gem bootstrap-sprockets but I have included it in my Gemfile:

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.6.3'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.3'
gem 'bootstrap-sass', '3.3.7'
.
.
.

My custom.scss file:

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

/* mixins, variables, etc. */

$gray-medium-light: #eaeaea;

/* universal */

body {
  padding-top: 60px;
}

section {
  overflow: auto;
}

textarea {
  resize: vertical;
}

.center {
  text-align: center;
  h1 {
    margin-bottom: 10px;
  }
}
.
.
.
Jessica
  • 1,083
  • 2
  • 12
  • 27

0 Answers0