Skip to content

Commit 131c143

Browse files
Merge pull request #4815 from platformsh/pr/show-error-ruby-bundler
Show an example of the error you get when having a version mismatch
2 parents 2aebada + 04e9971 commit 131c143

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

sites/platform/src/languages/ruby.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,14 +354,20 @@ For Rails, you have two choices:
354354
- For garbage collection tuning, you can read [this article](https://shopify.engineering/17489064-tuning-rubys-global-method-cache)
355355
and look for [discourse configurations](https://github.com/discourse/discourse_docker/blob/b259c8d38e0f42288fd279c9f9efd3cefbc2c1cb/templates/web.template.yml#L8)
356356

357-
- New images are released on a regular basis to apply security patches.
357+
- New images are released on a regular basis to apply security patches. While the minor version will not change (as you are specifying it in the `type` property), the patch version will be updated. You may encounter this kind of error:
358+
359+
```
360+
bundler: failed to load command: puma (/app/vendor/bundle/ruby/3.2.0/bin/puma)
361+
/app/.global/gems/bundler-2.4.22/lib/bundler/definition.rb:447:in `validate_ruby!': Your Ruby version is 3.2.9, but your Gemfile specified 3.2.8 (Bundler::RubyVersionMismatch)
362+
```
363+
358364
To avoid issues when such updates are performed, use
359365

360366
``` ruby
361367
ruby ENV["TARGET_RUBY_VERSION"] || File.read(File.join(File.dirname(__FILE__), ".ruby-version")).strip
362368
```
363369

364-
in your `Gemfile`.
370+
in your `Gemfile`, where `TARGET_RUBY_VERSION` has been defined as above.
365371

366372
## Troubleshooting
367373

sites/upsun/src/languages/ruby.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,14 +398,20 @@ For Rails, you can use the standard Rails `config/database.yml` with the values
398398

399399
- For garbage collection tuning, you can read [this article](https://shopify.engineering/17489064-tuning-rubys-global-method-cache)
400400
and look for [discourse configurations](https://github.com/discourse/discourse_docker/blob/b259c8d38e0f42288fd279c9f9efd3cefbc2c1cb/templates/web.template.yml#L8)
401-
- New images are released on a regular basis to apply security patches.
401+
- New images are released on a regular basis to apply security patches. While the minor version will not change (as you are specifying it in the `type` property), the patch version will be updated. You may encounter this kind of error:
402+
403+
```
404+
bundler: failed to load command: puma (/app/vendor/bundle/ruby/3.2.0/bin/puma)
405+
/app/.global/gems/bundler-2.4.22/lib/bundler/definition.rb:447:in `validate_ruby!': Your Ruby version is 3.2.9, but your Gemfile specified 3.2.8 (Bundler::RubyVersionMismatch)
406+
```
407+
402408
To avoid issues when such updates are performed, use
403409

404410
``` ruby
405411
ruby ENV["TARGET_RUBY_VERSION"] || File.read(File.join(File.dirname(__FILE__), ".ruby-version")).strip
406412
```
407413

408-
in your `Gemfile`.
414+
in your `Gemfile`, where `TARGET_RUBY_VERSION` has been defined as above.
409415

410416

411417
{{< repolist lang="ruby" displayName="Ruby" >}}

0 commit comments

Comments
 (0)