1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 07:08:01 +00:00

Add List The Running Ruby Version as a ruby til

This commit is contained in:
jbranchaud
2021-02-06 18:58:34 -06:00
parent 97f34fd079
commit d789368432
2 changed files with 18 additions and 1 deletions

View File

@@ -0,0 +1,16 @@
# List The Running Ruby Version
The running Ruby version can be listed with the `RUBY_VERSION` constant.
For instance, if my Ruby version is 3.0.0, then I could get the version like
so:
```ruby
> RUBY_VERSION
=> "3.0.0"
```
This is nice if you just want to check in an IRB session or if you need it as
part of a script.
[source](https://blog.arkency.com/which-ruby-version-am-i-using-how-to-check/)