After initiating a fresh Rails 7 app, I utilized the command line syntax:
$ rails new app_name --css=bootstrap
An error occurred during app creation specifically when including --css=bootstrap
:
Install esbuild
run yarn add esbuild from "."
...
info: The platform "darwin" is incompatible with this module.
info: "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="">[email protected]</a>" is an optional dependency and failed compatibility check. Excluding it from installation.
...
info: The CPU architecture "arm64" is incompatible with this module.
...
✨ Done in 1.60s.
I am using an Apple M1 machine.
While applying Bootstrap classes in the app, button and text styling appears correctly, but navbar styling does not apply as expected.
My queries are:
- Could these esbuild installation errors be causing the issue with Bootstrap?
- How can I ensure esbuild is installed properly when creating a new Rails 7 app with Bootstrap?
The Gemfile generated is as follows:
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby "3.1.2"
gem "rails", "~> 7.0.3"
gem "sprockets-rails"
gem "sqlite3", "~> 1.4"
gem "puma", "~> 5.0"
gem "jsbundling-rails"
gem "turbo-rails"
gem "stimulus-rails"
gem "cssbundling-rails"
gem "jbuilder"
gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]
gem "bootsnap", require: false
group :development, :test do
gem "debug", platforms: %i[ mri mingw x64_mingw ]
end
group :development do
gem "web-console"
end
group :test do
gem "capybara"
gem "selenium-webdriver"
gem "webdrivers"
end