lib/rails/generators/app_base.rb in railties-7.1.2 vs lib/rails/generators/app_base.rb in railties-7.1.3

- old
+ new

@@ -672,23 +672,11 @@ remove_file("Gemfile.lock") end end def run_bundle - if bundle_install? - bundle_command("install", "BUNDLE_IGNORE_MESSAGES" => "1") - - # The vast majority of Rails apps will be deployed on `x86_64-linux`. - platforms = ["--add-platform=x86_64-linux"] - - # Users that develop on M1 mac may use docker and would need `aarch64-linux` as well. - platforms << "--add-platform=aarch64-linux" if RUBY_PLATFORM.start_with?("arm64") - - platforms.each do |platform| - bundle_command("lock #{platform}", "BUNDLE_IGNORE_MESSAGES" => "1") - end - end + bundle_command("install", "BUNDLE_IGNORE_MESSAGES" => "1") if bundle_install? end def run_javascript return if options[:skip_javascript] || !bundle_install? @@ -711,9 +699,19 @@ rails_command "tailwindcss:install" elsif !using_js_runtime? && options[:css] == "sass" rails_command "dartsass:install" else rails_command "css:install:#{options[:css]}" + end + end + + def add_bundler_platforms + if bundle_install? + # The vast majority of Rails apps will be deployed on `x86_64-linux`. + bundle_command("lock --add-platform=x86_64-linux") + + # Users that develop on M1 mac may use docker and would need `aarch64-linux` as well. + bundle_command("lock --add-platform=aarch64-linux") if RUBY_PLATFORM.start_with?("arm64") end end def generate_bundler_binstub if bundle_install?