Generating a Rails app with 7.1.0.beta1 using bootstrap throws an error.
This seems to be related to Procfile.dev not existing when cssbundling-rails tries to update the file. Not entirely sure if this belongs here or in the cssbundling-rails repo.
rails --version
Rails 7.1.0.beta1
Minimal reproduction case:
rails new blog -c bootstrap
create
create README.md
create Rakefile
create .node-version
create .ruby-version
create config.ru
create .gitignore
create .gitattributes
create Gemfile
run git init -b main from "."
Initialized empty Git repository in /Users/josh/dev/blog/.git/
create app
create app/assets/config/manifest.js
create app/assets/stylesheets/application.css
create app/channels/application_cable/channel.rb
create app/channels/application_cable/connection.rb
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create app/jobs/application_job.rb
create app/mailers/application_mailer.rb
create app/models/application_record.rb
create app/views/layouts/application.html.erb
create app/views/layouts/mailer.html.erb
create app/views/layouts/mailer.text.erb
create app/assets/images
create app/assets/images/.keep
create app/controllers/concerns/.keep
create app/models/concerns/.keep
create bin
create bin/rails
create bin/rake
create bin/setup
create Dockerfile
create .dockerignore
create bin/docker-entrypoint
create config
create config/routes.rb
create config/application.rb
create config/environment.rb
create config/cable.yml
create config/puma.rb
create config/storage.yml
create config/environments
create config/environments/development.rb
create config/environments/production.rb
create config/environments/test.rb
create config/initializers
create config/initializers/assets.rb
create config/initializers/content_security_policy.rb
create config/initializers/cors.rb
create config/initializers/filter_parameter_logging.rb
create config/initializers/inflections.rb
create config/initializers/new_framework_defaults_7_1.rb
create config/initializers/permissions_policy.rb
create config/locales
create config/locales/en.yml
create config/master.key
append .gitignore
create config/boot.rb
create config/database.yml
create db
create db/seeds.rb
create lib
create lib/tasks
create lib/tasks/.keep
create lib/assets
create lib/assets/.keep
create log
create log/.keep
create public
create public/404.html
create public/422.html
create public/500.html
create public/apple-touch-icon-precomposed.png
create public/apple-touch-icon.png
create public/favicon.ico
create public/robots.txt
create tmp
create tmp/.keep
create tmp/pids
create tmp/pids/.keep
create tmp/cache
create tmp/cache/assets
create vendor
create vendor/.keep
create test/fixtures/files
create test/fixtures/files/.keep
create test/controllers
create test/controllers/.keep
create test/mailers
create test/mailers/.keep
create test/models
create test/models/.keep
create test/helpers
create test/helpers/.keep
create test/integration
create test/integration/.keep
create test/channels/application_cable/connection_test.rb
create test/test_helper.rb
create test/system
create test/system/.keep
create test/application_system_test_case.rb
create storage
create storage/.keep
create tmp/storage
create tmp/storage/.keep
remove config/initializers/cors.rb
remove config/initializers/new_framework_defaults_7_1.rb
run bundle install
Fetching gem metadata from https://rubygems.org/...........
Resolving dependencies...
Bundle complete! 16 Gemfile dependencies, 84 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
run bundle lock --add-platform=x86_64-linux
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Writing lockfile to /Users/josh/dev/blog/Gemfile.lock
run bundle lock --add-platform=aarch64-linux
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Writing lockfile to /Users/josh/dev/blog/Gemfile.lock
run bundle binstubs bundler
rails importmap:install
apply /Users/josh/.rvm/gems/ruby-3.2.2/gems/importmap-rails-1.2.1/lib/install/install.rb
Add Importmap include tags in application layout
insert app/views/layouts/application.html.erb
Create application.js module as entrypoint
create app/javascript/application.js
Use vendor/javascript for downloaded pins
create vendor/javascript
create vendor/javascript/.keep
Ensure JavaScript files are in the Sprocket manifest
append app/assets/config/manifest.js
Configure importmap paths in config/importmap.rb
create config/importmap.rb
Copying binstub
create bin/importmap
run bundle install
Bundle complete! 16 Gemfile dependencies, 84 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
run bundle lock --add-platform=x86_64-linux
Writing lockfile to /Users/josh/dev/blog/Gemfile.lock
run bundle lock --add-platform=aarch64-linux
Writing lockfile to /Users/josh/dev/blog/Gemfile.lock
rails turbo:install stimulus:install
apply /Users/josh/.rvm/gems/ruby-3.2.2/gems/turbo-rails-1.4.0/lib/install/turbo_with_importmap.rb
Import Turbo
append app/javascript/application.js
Pin Turbo
append config/importmap.rb
run bundle install
Bundle complete! 16 Gemfile dependencies, 84 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
run bundle lock --add-platform=x86_64-linux
Writing lockfile to /Users/josh/dev/blog/Gemfile.lock
run bundle lock --add-platform=aarch64-linux
Writing lockfile to /Users/josh/dev/blog/Gemfile.lock
apply /Users/josh/.rvm/gems/ruby-3.2.2/gems/turbo-rails-1.4.0/lib/install/turbo_needs_redis.rb
Enable redis in bundle
gsub Gemfile
run bundle install
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Bundle complete! 17 Gemfile dependencies, 86 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
run bundle lock --add-platform=x86_64-linux
Writing lockfile to /Users/josh/dev/blog/Gemfile.lock
run bundle lock --add-platform=aarch64-linux
Writing lockfile to /Users/josh/dev/blog/Gemfile.lock
Switch development cable to use redis
gsub config/cable.yml
run bundle install
Bundle complete! 17 Gemfile dependencies, 86 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
run bundle lock --add-platform=x86_64-linux
Writing lockfile to /Users/josh/dev/blog/Gemfile.lock
run bundle lock --add-platform=aarch64-linux
Writing lockfile to /Users/josh/dev/blog/Gemfile.lock
apply /Users/josh/.rvm/gems/ruby-3.2.2/gems/stimulus-rails-1.2.2/lib/install/stimulus_with_importmap.rb
Create controllers directory
create app/javascript/controllers
create app/javascript/controllers/index.js
create app/javascript/controllers/application.js
create app/javascript/controllers/hello_controller.js
Import Stimulus controllers
append app/javascript/application.js
Pin Stimulus
Appending: pin "@hotwired/stimulus", to: "stimulus.min.js", preload: true"
append config/importmap.rb
Appending: pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true
append config/importmap.rb
Pin all controllers
Appending: pin_all_from "app/javascript/controllers", under: "controllers"
append config/importmap.rb
run bundle install
Bundle complete! 17 Gemfile dependencies, 86 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
run bundle lock --add-platform=x86_64-linux
Writing lockfile to /Users/josh/dev/blog/Gemfile.lock
run bundle lock --add-platform=aarch64-linux
Writing lockfile to /Users/josh/dev/blog/Gemfile.lock
rails css:install:bootstrap
apply /Users/josh/.rvm/gems/ruby-3.2.2/gems/cssbundling-rails-1.3.1/lib/install/install.rb
Build into app/assets/builds
create app/assets/builds
create app/assets/builds/.keep
append app/assets/config/manifest.js
Stop linking stylesheets automatically
gsub app/assets/config/manifest.js
append .gitignore
append .gitignore
Remove app/assets/stylesheets/application.css so build output can take over
remove app/assets/stylesheets/application.css
Add stylesheet link tag in application layout
File unchanged! Either the supplied flag value not found or the content has already been inserted! app/views/layouts/application.html.erb
Add default package.json
create package.json
Add default Procfile.dev
bin/rails aborted!
Rails::Generators::Error: The template [/Users/josh/.rvm/gems/ruby-3.2.2/gems/cssbundling-rails-1.3.1/lib/install/install.rb] could not be loaded. Error: Could not find "/Users/josh/.rvm/gems/ruby-3.2.2/gems/cssbundling-rails-1.3.1/lib/install/Procfile_for_node" in any of your source paths. Your current source paths are:
/Users/josh/.rvm/gems/ruby-3.2.2/gems/railties-7.1.0.beta1/lib/rails/generators/rails/app/templates
Caused by:
Thor::Error: Could not find "/Users/josh/.rvm/gems/ruby-3.2.2/gems/cssbundling-rails-1.3.1/lib/install/Procfile_for_node" in any of your source paths. Your current source paths are:
/Users/josh/.rvm/gems/ruby-3.2.2/gems/railties-7.1.0.beta1/lib/rails/generators/rails/app/templates
Tasks: TOP => app:template
(See full trace by running task with --trace)
apply /Users/josh/.rvm/gems/ruby-3.2.2/gems/cssbundling-rails-1.3.1/lib/install/bootstrap/install.rb
Install Bootstrap with Bootstrap Icons, Popperjs/core and Autoprefixer
create app/assets/stylesheets/application.bootstrap.scss
run yarn add sass bootstrap bootstrap-icons @popperjs/core postcss postcss-cli autoprefixer nodemon from "."
yarn add v1.22.17
info No lockfile found.
[1/4] π Resolving packages...
[2/4] π Fetching packages...
[3/4] π Linking dependencies...
[4/4] π¨ Building fresh packages...
success Saved lockfile.
success Saved 94 new dependencies.
info Direct dependencies
ββ @popperjs/core@2.11.8
ββ autoprefixer@10.4.15
ββ bootstrap-icons@1.11.0
ββ bootstrap@5.3.1
ββ nodemon@3.0.1
ββ postcss-cli@10.1.0
ββ postcss@8.4.29
ββ sass@1.66.1
info All dependencies
ββ @nodelib/fs.scandir@2.1.5
ββ @nodelib/fs.stat@2.0.5
ββ @nodelib/fs.walk@1.2.8
ββ @popperjs/core@2.11.8
ββ abbrev@1.1.1
ββ ansi-regex@5.0.1
ββ ansi-styles@4.3.0
ββ anymatch@3.1.3
ββ autoprefixer@10.4.15
ββ balanced-match@1.0.2
ββ binary-extensions@2.2.0
ββ bootstrap-icons@1.11.0
ββ bootstrap@5.3.1
ββ brace-expansion@1.1.11
ββ braces@3.0.2
ββ browserslist@4.21.10
ββ caniuse-lite@1.0.30001534
ββ chokidar@3.5.3
ββ cliui@8.0.1
ββ color-convert@2.0.1
ββ color-name@1.1.4
ββ concat-map@0.0.1
ββ debug@3.2.7
ββ dependency-graph@0.11.0
ββ dir-glob@3.0.1
ββ electron-to-chromium@1.4.520
ββ emoji-regex@8.0.0
ββ fast-glob@3.3.1
ββ fastq@1.15.0
ββ fill-range@7.0.1
ββ fraction.js@4.3.6
ββ fs-extra@11.1.1
ββ fsevents@2.3.3
ββ get-caller-file@2.0.5
ββ get-stdin@9.0.0
ββ glob-parent@5.1.2
ββ globby@13.2.2
ββ graceful-fs@4.2.11
ββ has-flag@3.0.0
ββ ignore-by-default@1.0.1
ββ ignore@5.2.4
ββ immutable@4.3.4
ββ is-binary-path@2.1.0
ββ is-extglob@2.1.1
ββ is-fullwidth-code-point@3.0.0
ββ is-glob@4.0.3
ββ is-number@7.0.0
ββ jsonfile@6.1.0
ββ lilconfig@2.1.0
ββ lru-cache@6.0.0
ββ merge2@1.4.1
ββ micromatch@4.0.5
ββ minimatch@3.1.2
ββ ms@2.1.3
ββ nanoid@3.3.6
ββ node-releases@2.0.13
ββ nodemon@3.0.1
ββ nopt@1.0.10
ββ normalize-path@3.0.0
ββ normalize-range@0.1.2
ββ path-type@4.0.0
ββ picomatch@2.3.1
ββ pify@2.3.0
ββ postcss-cli@10.1.0
ββ postcss-load-config@4.0.1
ββ postcss-reporter@7.0.5
ββ postcss-value-parser@4.2.0
ββ postcss@8.4.29
ββ pretty-hrtime@1.0.3
ββ pstree.remy@1.1.8
ββ queue-microtask@1.2.3
ββ read-cache@1.0.0
ββ readdirp@3.6.0
ββ require-directory@2.1.1
ββ reusify@1.0.4
ββ run-parallel@1.2.0
ββ sass@1.66.1
ββ simple-update-notifier@2.0.0
ββ slash@5.1.0
ββ source-map-js@1.0.2
ββ string-width@4.2.3
ββ strip-ansi@6.0.1
ββ supports-color@5.5.0
ββ thenby@1.3.4
ββ to-regex-range@5.0.1
ββ touch@3.1.0
ββ undefsafe@2.0.5
ββ update-browserslist-db@1.0.11
ββ wrap-ansi@7.0.0
ββ y18n@5.0.8
ββ yallist@4.0.0
ββ yaml@2.3.2
ββ yargs-parser@21.1.1
ββ yargs@17.7.2
β¨ Done in 3.06s.
insert config/initializers/assets.rb
Appending Bootstrap JavaScript import to default entry point
append app/javascript/application.js
Add build:css:compile script
run npm pkg set scripts.build:css:compile="sass ./app/assets/stylesheets/application.bootstrap.scss:./app/assets/builds/application.css --no-source-map --load-path=node_modules" from "."
run yarn build:css:compile from "."
yarn run v1.22.17
$ sass ./app/assets/stylesheets/application.bootstrap.scss:./app/assets/builds/application.css --no-source-map --load-path=node_modules
Deprecation Warning: Passing percentage units to the global abs() function is deprecated.
In the future, this will emit a CSS abs() function to be resolved by the browser.
To preserve current behavior: math.abs(100%)
To emit a CSS abs() now: abs(#{100%})
More info: https://sass-lang.com/d/abs-percent
β·
57 β $dividend: abs($dividend);
β ^^^^^^^^^^^^^^
β΅
node_modules/bootstrap/scss/vendor/_rfs.scss 57:14 divide()
node_modules/bootstrap/scss/mixins/_grid.scss 59:12 row-cols()
node_modules/bootstrap/scss/mixins/_grid.scss 85:13 @content
node_modules/bootstrap/scss/mixins/_breakpoints.scss 68:5 media-breakpoint-up()
node_modules/bootstrap/scss/mixins/_grid.scss 72:5 make-grid-columns()
node_modules/bootstrap/scss/_grid.scss 38:3 @import
bootstrap/scss/bootstrap.scss 20:9 @import
app/assets/stylesheets/application.bootstrap.scss 1:9 root stylesheet
β¨ Done in 1.42s.
Add build:css:prefix script
run npm pkg set scripts.build:css:prefix="postcss ./app/assets/builds/application.css --use=autoprefixer --output=./app/assets/builds/application.css" from "."
run yarn build:css:prefix from "."
yarn run v1.22.17
$ postcss ./app/assets/builds/application.css --use=autoprefixer --output=./app/assets/builds/application.css
β¨ Done in 0.62s.
Add build:css script
run npm pkg set scripts.build:css="yarn build:css:compile && yarn build:css:prefix" from "."
run yarn build:css from "."
yarn run v1.22.17
$ yarn build:css:compile && yarn build:css:prefix
$ sass ./app/assets/stylesheets/application.bootstrap.scss:./app/assets/builds/application.css --no-source-map --load-path=node_modules
Deprecation Warning: Passing percentage units to the global abs() function is deprecated.
In the future, this will emit a CSS abs() function to be resolved by the browser.
To preserve current behavior: math.abs(100%)
To emit a CSS abs() now: abs(#{100%})
More info: https://sass-lang.com/d/abs-percent
β·
57 β $dividend: abs($dividend);
β ^^^^^^^^^^^^^^
β΅
node_modules/bootstrap/scss/vendor/_rfs.scss 57:14 divide()
node_modules/bootstrap/scss/mixins/_grid.scss 59:12 row-cols()
node_modules/bootstrap/scss/mixins/_grid.scss 85:13 @content
node_modules/bootstrap/scss/mixins/_breakpoints.scss 68:5 media-breakpoint-up()
node_modules/bootstrap/scss/mixins/_grid.scss 72:5 make-grid-columns()
node_modules/bootstrap/scss/_grid.scss 38:3 @import
bootstrap/scss/bootstrap.scss 20:9 @import
app/assets/stylesheets/application.bootstrap.scss 1:9 root stylesheet
$ postcss ./app/assets/builds/application.css --use=autoprefixer --output=./app/assets/builds/application.css
β¨ Done in 1.76s.
Add watch:css script
run npm pkg set scripts.watch:css="nodemon --watch ./app/assets/stylesheets/ --ext scss --exec "yarn build:css"" from "."
npm ERR! code EUSAGE
npm ERR!
npm ERR! npm pkg set expects a key=value pair of args.
npm ERR!
npm ERR! Manages your package.json
npm ERR!
npm ERR! Usage:
npm ERR! npm pkg set <key>=<value> [<key>=<value> ...]
npm ERR! npm pkg get [<key> [<key> ...]]
npm ERR! npm pkg delete <key> [<key> ...]
npm ERR! npm pkg set [<array>[<index>].<key>=<value> ...]
npm ERR! npm pkg set [<array>[].<key>=<value> ...]
npm ERR! npm pkg fix
npm ERR!
npm ERR! Options:
npm ERR! [-f|--force] [--json]
npm ERR! [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
npm ERR! [-ws|--workspaces]
npm ERR!
npm ERR! Run "npm help pkg" for more info
npm ERR! A complete log of this run can be found in: /Users/josh/.npm/_logs/2023-09-13T21_31_54_674Z-debug-0.log
gsub Procfile.dev
bin/rails aborted!
Rails::Generators::Error: The template [/Users/josh/.rvm/gems/ruby-3.2.2/gems/cssbundling-rails-1.3.1/lib/install/bootstrap/install.rb] could not be loaded. Error: No such file or directory @ rb_sysopen - /Users/josh/dev/blog/Procfile.dev
Caused by:
Errno::ENOENT: No such file or directory @ rb_sysopen - /Users/josh/dev/blog/Procfile.dev
Tasks: TOP => app:template
(See full trace by running task with --trace)
Steps to reproduce
Generating a Rails app with
7.1.0.beta1
using bootstrap throws an error.This seems to be related to
Procfile.dev
not existing whencssbundling-rails
tries to update the file. Not entirely sure if this belongs here or in thecssbundling-rails
repo.Minimal reproduction case:
Expected behavior
Rails app is successfully generated.
Actual behavior
An error is thrown.
System configuration
Rails version: 7.1.0.beta1 Ruby version: 3.2.2