Skip to content

Commit

Permalink
Document file option for ruby directive
Browse files Browse the repository at this point in the history
This is already documented on the
[manpage](https://bundler.io/v2.5/man/gemfile.5.html#VERSION-required-)
but it seems like it makes sense to have on this page as well.

Feature was implemented in rubygems/rubygems#6876

This copy is lifted from the manpage source https://github.com/rubygems/rubygems/blob/6bbc8bed344eeaadcbd8dfcc6e20c9e1eb734d96/bundler/lib/bundler/man/gemfile.5.ronn?plain=1#L72-L80
  • Loading branch information
albertchae committed Feb 6, 2024
1 parent 5968648 commit ffe36cf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions source/guides/gemfile_ruby.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ It's also possible to restrict the patchlevel of the Ruby used by doing the foll
ruby '1.9.3', :patchlevel => '448'
~~~

If you wish to derive your Ruby version from a version file (i.e. `.ruby-version`),
you can use the `file` option instead.

~~~ruby
ruby file: ".ruby-version"
~~~

The version file should conform to any of the following formats:

- `3.1.2` (`.ruby-version`)
- `ruby 3.1.2` ([`.tool-versions`](https://asdf-vm.com/manage/configuration.html#tool-versions))

Bundler will make checks against the current running Ruby VM to make sure it matches what is specified in the `Gemfile`. If things don't match, Bundler will raise an Exception explaining what doesn't match.

~~~
Expand Down

0 comments on commit ffe36cf

Please sign in to comment.