File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -515,7 +515,12 @@ def using_bun?
515515 end
516516
517517 def references_ruby_version_file?
518- @references_ruby_version_file ||= IO . read ( "Gemfile" ) . include? ( ".ruby-version" )
518+ @references_ruby_version_file ||= ruby_version_file . present?
519+ end
520+
521+ def ruby_version_file
522+ match = IO . read ( "Gemfile" ) . match ( /ruby file: ["'](.*)["']/ )
523+ match ? match [ 1 ] : nil
519524 end
520525
521526 def using_redis?
Original file line number Diff line number Diff line change 99# For a containerized dev environment, see Dev Containers: https://guides.rubyonrails.org/getting_started_with_devcontainer.html
1010<% end -%>
1111
12- # Make sure RUBY_VERSION matches the Ruby version in .ruby-version
12+ # Make sure RUBY_VERSION matches the Ruby version in <%= ruby_version_file || ' .ruby-version' %>
1313ARG RUBY_VERSION=<%= RUBY_VERSION %>
1414<% if api_client_dir -%>
1515<%= render partial : 'node_client' %>
@@ -95,7 +95,7 @@ ENV <%= build_env.join(" \\\n ") %>
9595
9696<% end -%>
9797# Install application gems
98- COPY<% if options . link? %> --link<% end %> Gemfile Gemfile.lock <% if references_ruby_version_file? %> .ruby-version <% end %> ./
98+ COPY<% if options . link? %> --link<% end %> Gemfile Gemfile.lock <% if references_ruby_version_file? %> <%= ruby_version_file %> <% end %> ./
9999<% if @netpopbug && Rails . env != "test" -%>
100100RUN sed -i "/net-pop (0.1.2)/a\ net-protocol" Gemfile.lock
101101<% end -%>
You can’t perform that action at this time.
0 commit comments