Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Gem::Installer#shebang

shebang(bin_file_name)

Generates a ! line for bin_file_name‘s wrapper copying arguments if necessary.

If the :custom_shebang config is set, then it is used as a template for how to create the shebang used for to run a gem’s executables.

The template supports 4 expansions:

$env    the path to the unix env utility
$ruby   the path to the currently running ruby interpreter
$exec   the path to the gem's executable
$name   the name of the gem the executable is for