'Production build failed from Bootstrap 5 gem on Netlify
I cloned a repository for using Jekyll 4 and the Bootstrap 5 gem. https://github.com/MichaelCurrin/jekyll-bootstrap-quickstart
It work locally but not in production.
I use Netlify as hosting service. The build is done from the fetched gem but @import "bootstrap-5.1.3/assets/stylesheets/bootstrap" seems pointing in the wrong path, how can i point the @import to 'opt/build/cache/bundle' in production mode ? Thx
10:52:00 AM: Using sassc-rails 2.1.2
10:52:00 AM: Fetching bootstrap 5.1.3
10:52:00 AM: Installing bootstrap 5.1.3
10:52:00 AM: Bundle complete! 3 Gemfile dependencies, 57 gems now installed.
10:52:00 AM: Bundled gems are installed into `/opt/build/cache/bundle`
10:52:00 AM: Gem bundle installed
bundle exec jekyll build
10:52:02 AM: Configuration file: /opt/build/repo/_config.yml
10:52:02 AM: Source: /opt/build/repo
10:52:02 AM: Destination: /opt/build/repo/_site
10:52:02 AM: Incremental build: disabled. Enable with --incremental
10:52:02 AM: Generating...
10:52:02 AM: Conversion error: Jekyll::Converters::Scss encountered an error while converting 'assets/css/styles.scss':
10:52:02 AM: Error: File to import not found or unreadable: bootstrap-5.1.3/assets/stylesheets/bootstrap. on line 7:1 of styles.scss >> @import "bootstrap-5.1.3/assets/stylesheets/bootstrap"; ^
10:52:02 AM: ------------------------------------------------
10:52:02 AM: Jekyll 4.2.2 Please append `--trace` to the `build` command
10:52:02 AM: for any additional information or backtrace.
10:52:02 AM: ------------------------------------------------
config.yml
### Site metadata
title: My site
description: Starter template for using Jekyll 4 and the Bootstrap gem
sass:
load_paths:
- _sass/
- vendor/bundle/ruby/3.0.0/gems/
defaults:
- scope:
path: "*.md"
values:
layout: page
exclude:
- LICENSE
- README.md
- Makefile
- sample.png
Solution 1:[1]
Finally, instead of the use of the gem "bootstrap", i copied/paste the bootstrap library in the CSS folder.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | AnnABlue |
