Skip to content

Commit 1af472c

Browse files
itaratoeregon
authored andcommitted
Extended the workflow documentation with jt ruby builds for ruby version managers.
1 parent b797073 commit 1af472c

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

doc/contributor/workflow.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ export SYSTEM_RUBY=/path/to/mri/bin/ruby
4444
alias jt=/path/to/truffleruby/bin/jt
4545
```
4646

47+
Note: `SYSTEM_RUBY` should be CRuby version 2.3 or higher.
48+
4749
```bash
4850
jt --help
4951
```
@@ -146,14 +148,25 @@ or use one of the `native*` build configuration (which also builds a native truf
146148

147149
## Running
148150

149-
`jt ruby` runs TruffleRuby. You can use it exactly as you'd run the MRI `ruby`
150-
command. Additionally, `jt ruby` sets a couple of extra options to help you when
151+
### Running Small Scripts
152+
153+
`jt ruby` runs TruffleRuby.
154+
You can use it exactly as you'd run the MRI `ruby` command and this is useful to compare behavior.
155+
Additionally, `jt ruby` sets a couple of extra options to help you when
151156
developing, such as loading the core library from disk rather than the JAR.
152157
`jt ruby` prints the real command it's running as it starts.
153158

154-
If you are running a Ruby environment manager like `rvm`, `rbenv`, or `chruby`
155-
please run `rvm use system`, `rbenv system`, or `chruby system` to clear their
156-
environment variables, so that the correct gems are picked up.
159+
`jt ruby` does not add TruffleRuby to `PATH` and does not support installing gems
160+
if `GEM_HOME` or `GEM_PATH` is set, see below for that.
161+
162+
### Running Ruby Programs Which Need Gems
163+
164+
The best here is to use a Ruby manager like `rbenv` or `chruby` for this.
165+
`jt build` automatically registers any truffleruby build with `rbenv` or `chruby`.
166+
So you can simply `chruby truffleruby-jvm` or `rbenv shell truffleruby-jvm` (adapt the name for a different build configuration).
167+
And with that, the gem environment is properly setup and you can use TruffleRuby just like you would use CRuby, including using `gem`, `bundle`, `rake`, `ruby`, etc.
168+
169+
### Build Configurations
157170

158171
By default, `jt ruby` runs the `jvm` build of TruffleRuby (that is, built with the `--jvm` [build
159172
configuration](#building) and using the default build name) and aborts if this build doesn't exist.

0 commit comments

Comments
 (0)