Skip to content

Commit 1084b22

Browse files
committed
Don't add bundler platforms for JRuby
The gems used by a Rails application on JRuby can't be resolved in other platforms. Fixes rails#54894.
1 parent f4ec7e8 commit 1084b22

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

railties/lib/rails/generators/app_base.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ def depends_on_system_test?
661661
end
662662

663663
def depend_on_bootsnap?
664-
!options[:skip_bootsnap] && !options[:dev] && !defined?(JRUBY_VERSION)
664+
!options[:skip_bootsnap] && !options[:dev] && !jruby?
665665
end
666666

667667
def target_rails_prerelease(self_command = "new")
@@ -737,7 +737,7 @@ def run_solid
737737
end
738738

739739
def add_bundler_platforms
740-
if bundle_install?
740+
if bundle_install? && !jruby?
741741
# The vast majority of Rails apps will be deployed on `x86_64-linux`.
742742
bundle_command("lock --add-platform=x86_64-linux")
743743

@@ -746,6 +746,10 @@ def add_bundler_platforms
746746
end
747747
end
748748

749+
def jruby?
750+
defined?(JRUBY_VERSION)
751+
end
752+
749753
def empty_directory_with_keep_file(destination, config = {})
750754
empty_directory(destination, config)
751755
keep_file(destination)

0 commit comments

Comments
 (0)