The ruby shebang in several of my scripts is the usual system (MacOS) /usr/bin/ruby. I use RVM for my rubies, so it's often different than the system install of ruby.
Is there a way for a shebang to contain a reference or alias of some sort, so that it always points to the current RVM chosen installation?
Use:
#!/usr/bin/env ruby
This tells the shell to look up the Ruby in the $PATH which will be the correct one managed by RVM in most cases if you use RVM.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With