i am just wondering. I want to create a new rails app and have following setup on my linux system:
- ruby 3.0.3 via RVM
- yarn v1.22.17
and
gem install bundler -v 2.2.33
gem install rails -v 7.0.0
If I create a new app via
rails new my_app -T --database=postgresql --javascript=webpack --css=bootstrap
Rails 7.1.0.alpha is used instead of Rails 7.0
In the created Gemfile following version is listed:
# Use main development branch of Rails
gem "rails", github: "rails/rails", branch: "main"
$ rails new my_app -T -G --database=postgresql --javascript=webpack --css=bootstrap
create
create Gemfile
run bundle install
Fetching https://github.com/rails/rails.git
Resolving dependencies...Fetching gem metadata from https://rubygems.org/.......
..........
Using rake 13.0.6
Using concurrent-ruby 1.1.9
Using minitest 5.15.0
Using marcel 1.0.2
Using mini_mime 1.1.2
Using bundler 2.2.33
Using crass 1.0.6
Using websocket-extensions 0.1.5
Using rack 2.2.3
Using nio4r 2.5.8
Using i18n 1.8.11
Using erubi 1.10.0
Using racc 1.6.0
Using method_source 1.0.0
Using thor 1.1.0
Using zeitwerk 2.5.2
Using builder 3.2.4
Using tzinfo 2.0.4
Using mail 2.7.1
Using activesupport 7.1.0.alpha from https://github.com/rails/rails.git (at main@ca6e314)
Using rack-test 1.1.0
Using nokogiri 1.12.5 (x86_64-linux)
Using websocket-driver 0.7.5
Using loofah 2.13.0
Using rails-html-sanitizer 1.4.2
Using rails-dom-testing 2.0.3
Using globalid 1.0.0
Using activemodel 7.1.0.alpha from https://github.com/rails/rails.git (at main@ca6e314)
Using actionview 7.1.0.alpha from https://github.com/rails/rails.git (at main@ca6e314)
Using activejob 7.1.0.alpha from https://github.com/rails/rails.git (at main@ca6e314)
Using activerecord 7.1.0.alpha from https://github.com/rails/rails.git (at main@ca6e314)
Using actionpack 7.1.0.alpha from https://github.com/rails/rails.git (at main@ca6e314)
Using actioncable 7.1.0.alpha from https://github.com/rails/rails.git (at main@ca6e314)
Using activestorage 7.1.0.alpha from https://github.com/rails/rails.git (at main@ca6e314)
Using actionmailer 7.1.0.alpha from https://github.com/rails/rails.git (at main@ca6e314)
Using railties 7.1.0.alpha from https://github.com/rails/rails.git (at main@ca6e314)
Using actionmailbox 7.1.0.alpha from https://github.com/rails/rails.git (at main@ca6e314)
Using actiontext 7.1.0.alpha from https://github.com/rails/rails.git (at main@ca6e314)
Using rails 7.1.0.alpha from https://github.com/rails/rails.git (at main@ca6e314)
Bundle complete! 1 Gemfile dependency, 39 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
run bundle exec rails new /home/micklich/noscan/FA-Zunft/DIAAS/diaas_fa_rails7/my_app -T -G --database=postgresql --main --javascript=webpack --css=bootstrap
exist
remove Gemfile
remove Gemfile.lock
create README.md
create Rakefile
create .ruby-version
create config.ru
create Gemfile
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 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
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 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 https://github.com/rails/rails.git
Fetching gem metadata from https://rubygems.org/...........
Resolving dependencies...
Using rake 13.0.6
Using concurrent-ruby 1.1.9
Using minitest 5.15.0
Using builder 3.2.4
Using mini_mime 1.1.2
Using bindex 0.8.1
Using msgpack 1.4.2
Using bundler 2.2.33
Using erubi 1.10.0
Using crass 1.0.6
Using websocket-extensions 0.1.5
Using marcel 1.0.2
Using racc 1.6.0
Using rack 2.2.3
Using nio4r 2.5.8
Using method_source 1.0.0
Using thor 1.1.0
Using zeitwerk 2.5.2
Using websocket-driver 0.7.5
Using pg 1.2.3
Using i18n 1.8.11
Using tzinfo 2.0.4
Using mail 2.7.1
Using activesupport 7.1.0.alpha from https://github.com/rails/rails.git (at main@ca6e314)
Using io-console 0.5.9
Using nokogiri 1.12.5 (x86_64-linux)
Using reline 0.3.0
Using loofah 2.13.0
Using puma 5.5.2
Using bootsnap 1.9.3
Using rails-html-sanitizer 1.4.2
Using sprockets 4.0.2
Using irb 1.4.1
Using rack-test 1.1.0
Using debug 1.4.0
Using rails-dom-testing 2.0.3
Using globalid 1.0.0
Using actionview 7.1.0.alpha from https://github.com/rails/rails.git (at main@ca6e314)
Using activemodel 7.1.0.alpha from https://github.com/rails/rails.git (at main@ca6e314)
Using activejob 7.1.0.alpha from https://github.com/rails/rails.git (at main@ca6e314)
Using actionpack 7.1.0.alpha from https://github.com/rails/rails.git (at main@ca6e314)
Using jbuilder 2.11.5
Using activerecord 7.1.0.alpha from https://github.com/rails/rails.git (at main@ca6e314)
Using actioncable 7.1.0.alpha from https://github.com/rails/rails.git (at main@ca6e314)
Using sprockets-rails 3.4.2
Using actionmailer 7.1.0.alpha from https://github.com/rails/rails.git (at main@ca6e314)
Using railties 7.1.0.alpha from https://github.com/rails/rails.git (at main@ca6e314)
Using activestorage 7.1.0.alpha from https://github.com/rails/rails.git (at main@ca6e314)
Using actionmailbox 7.1.0.alpha from https://github.com/rails/rails.git (at main@ca6e314)
Using actiontext 7.1.0.alpha from https://github.com/rails/rails.git (at main@ca6e314)
Using stimulus-rails 1.0.2
Using turbo-rails 1.0.0
Using jsbundling-rails 1.0.0
Using web-console 4.2.0
Using cssbundling-rails 1.0.0
Using rails 7.1.0.alpha from https://github.com/rails/rails.git (at main@ca6e314)
Bundle complete! 13 Gemfile dependencies, 56 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
run bundle binstubs bundler
rails javascript:install:webpack
Compile into app/assets/builds
create app/assets/builds
create app/assets/builds/.keep
append app/assets/config/manifest.js
Add JavaScript include tag in application layout
insert app/views/layouts/application.html.erb
Create default entrypoint in app/javascript/application.js
create app/javascript
create app/javascript/application.js
Add default package.json
create package.json
Add default Procfile.dev
create Procfile.dev
Ensure foreman is installed
run gem install foreman from "."
Successfully installed foreman-0.87.2
Parsing documentation for foreman-0.87.2
Done installing documentation for foreman after 0 seconds
1 gem installed
Add bin/dev to start foreman
create bin/dev
Install Webpack with config
create webpack.config.js
run yarn add webpack webpack-cli 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 102 new dependencies.
info Direct dependencies
├─ [email protected]
└─ [email protected]
info All dependencies
├─ @discoveryjs/[email protected]
├─ @types/[email protected]
├─ @types/[email protected]
├─ @types/[email protected]
├─ @types/[email protected]
├─ @webassemblyjs/[email protected]
├─ @webassemblyjs/[email protected]
├─ @webassemblyjs/[email protected]
├─ @webassemblyjs/[email protected]
├─ @webassemblyjs/[email protected]
├─ @webassemblyjs/[email protected]
├─ @webpack-cli/[email protected]
├─ @webpack-cli/[email protected]
├─ @webpack-cli/[email protected]
├─ @xtuc/[email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
└─ [email protected]
Done in 3.40s.
Add build script
run npm set-script build "webpack --config webpack.config.js" from "."
run yarn build from "."
yarn run v1.22.17
$ webpack --config webpack.config.js
asset application.js 0 bytes [emitted] [minimized] (name: application)
./app/javascript/application.js 57 bytes [built] [code generated]
webpack 5.65.0 compiled successfully in 159 ms
Done in 0.63s.
rails turbo:install stimulus:install
Import Turbo
append app/javascript/application.js
Install Turbo
run yarn add @hotwired/turbo-rails from "."
yarn add v1.22.17
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 3 new dependencies.
info Direct dependencies
└─ @hotwired/[email protected]
info All dependencies
├─ @hotwired/[email protected]
├─ @hotwired/[email protected]
└─ @rails/[email protected]
Done in 0.86s.
Run turbo:install:redis to switch on Redis and use it in development for turbo streams
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
Install Stimulus
run yarn add @hotwired/stimulus from "."
yarn add v1.22.17
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
└─ @hotwired/[email protected]
info All dependencies
└─ @hotwired/[email protected]
Done in 0.83s.
rails css:install:bootstrap
Build into app/assets/builds
exist app/assets/builds
identical app/assets/builds/.keep
File unchanged! The supplied flag value not found! app/assets/config/manifest.js
Stop linking stylesheets automatically
gsub app/assets/config/manifest.js
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! The supplied flag value not found! app/views/layouts/application.html.erb
append Procfile.dev
Add bin/dev to start foreman
identical bin/dev
Install Bootstrap with Popperjs/core
create app/assets/stylesheets/application.bootstrap.scss
run yarn add sass bootstrap @popperjs/core from "."
yarn add v1.22.17
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 19 new dependencies.
info Direct dependencies
├─ @popperjs/[email protected]
├─ [email protected]
└─ [email protected]
info All dependencies
├─ @popperjs/[email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
└─ [email protected]
Done in 1.23s.
Appending Bootstrap JavaScript import to default entry point
append app/javascript/application.js
Add build:css script
run npm set-script build:css "sass ./app/assets/stylesheets/application.bootstrap.scss ./app/assets/builds/application.css --no-source-map --load-path=node_modules" from "."
run yarn build:css 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
Done in 1.65s.
Any reason why this happens and how to achieve to get rails 7.0.0
2
Answers
What is the output of running this?
gem list rails --local
It seems you have multiple versions of rails installed and
rails new
would generate from the most recent version.You can do
rails _7.0.0_ new my_app -T --database=postgresql --javascript=webpack --css=bootstrap
to use rails version 7.0.0.The parameter
--css=bootstrap
ofrails new
seems to force--javascript=esbuild
(and rails 7.1 alpha) automatically.I’ve researched this site for rescue: https://dev.to/coorasse/rails-7-bootstrap-5-and-importmaps-without-nodejs-4g8