RVM shebang in a ruby script
mouse 124 · person cloud · link
Last update
2022-02-26
2022
02-26
« — »

run script with the default ruby version

  • option A:
1
2
#!/usr/bin/env -S ${HOME}/.rvm/bin/rvm-shebang-ruby
puts RUBY_VERSION
  • option B:
1
2
#!/usr/bin/env -S ${HOME}/.rvm/bin/rvm default do ruby
puts RUBY_VERSION

run script with desired tuby version

1
2
#!/usr/bin/env -S ${HOME}/.rvm/bin/rvm ruby-3.0.0 do ruby
puts RUBY_VERSION