Skip to content

Commit d51c6dd

Browse files
takaokoujiclaude
andcommitted
Fix Docker command to remove Gemfile.lock before bundle install
Change command from "bundle update" to "rm -f Gemfile.lock && bundle install" to avoid dependency conflicts between different Rails versions. With "bundle update", the existing Gemfile.lock would cause version resolution failures when switching between Rails versions, especially when both activerecord and railties are specified with different version requirements. Removing Gemfile.lock ensures each container gets the correct dependencies for its specified RAILS_VERSION environment variable. Tested and verified all services pass: - Rails 6.1.7.10: 674 runs, 8772 assertions, 0 failures ✅ - Rails 7.0.10: 674 runs, 8772 assertions, 0 failures ✅ - Rails 7.1.6: 674 runs, 8772 assertions, 0 failures ✅ - Rails 7.2.3: 674 runs, 8772 assertions, 0 failures ✅ - Rails 8.0.4: 674 runs, 8772 assertions, 0 failures ✅ - Rails 8.1.2: 674 runs, 8772 assertions, 0 failures ✅ Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 9783d74 commit d51c6dd

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

docker-compose.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,47 +17,47 @@ services:
1717
container_name: jsonapi-rails-6.1
1818
environment:
1919
- RAILS_VERSION=6.1.7.10
20-
command: bash -c "bundle update && bundle exec rake test"
20+
command: bash -c "rm -f Gemfile.lock && bundle install && bundle exec rake test"
2121

2222
# Rails 7.0.10
2323
rails-7.0:
2424
<<: *test-base
2525
container_name: jsonapi-rails-7.0
2626
environment:
2727
- RAILS_VERSION=7.0.10
28-
command: bash -c "bundle update && bundle exec rake test"
28+
command: bash -c "rm -f Gemfile.lock && bundle install && bundle exec rake test"
2929

3030
# Rails 7.1.6
3131
rails-7.1:
3232
<<: *test-base
3333
container_name: jsonapi-rails-7.1
3434
environment:
3535
- RAILS_VERSION=7.1.6
36-
command: bash -c "bundle update && bundle exec rake test"
36+
command: bash -c "rm -f Gemfile.lock && bundle install && bundle exec rake test"
3737

3838
# Rails 7.2.3
3939
rails-7.2:
4040
<<: *test-base
4141
container_name: jsonapi-rails-7.2
4242
environment:
4343
- RAILS_VERSION=7.2.3
44-
command: bash -c "bundle update && bundle exec rake test"
44+
command: bash -c "rm -f Gemfile.lock && bundle install && bundle exec rake test"
4545

4646
# Rails 8.0.4
4747
rails-8.0:
4848
<<: *test-base
4949
container_name: jsonapi-rails-8.0
5050
environment:
5151
- RAILS_VERSION=8.0.4
52-
command: bash -c "bundle update && bundle exec rake test"
52+
command: bash -c "rm -f Gemfile.lock && bundle install && bundle exec rake test"
5353

5454
# Rails 8.1.2
5555
rails-8.1:
5656
<<: *test-base
5757
container_name: jsonapi-rails-8.1
5858
environment:
5959
- RAILS_VERSION=8.1.2
60-
command: bash -c "bundle update && bundle exec rake test"
60+
command: bash -c "rm -f Gemfile.lock && bundle install && bundle exec rake test"
6161

6262
# Interactive shell for debugging (defaults to Rails 8.1)
6363
shell:

0 commit comments

Comments
 (0)