RVM shebang in a ruby script
mouse 847 · person cloud · link
Last update
2023-05-10
2023
05-10
« — »

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 ruby version

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