De acordo com os documentos oficiais , parece que você precisa prefixar seus scripts como este :
#!/usr/bin/env ruby
E, em seguida, faça uma das seguintes ações para informar rbenv
qual versão do Ruby usar:
trecho: link
Choosing the Ruby Version
When you execute a shim,
rbenv
determines which Ruby version to use by reading it from the following sources, in this order:
The
RBENV_VERSION
environment variable, if specified. You can use therbenv
shell command to set this environment variable in your current shell session.The first
.ruby-version
file found by searching the directory of the script you are executing and each of its parent directories until reaching the root of your filesystem.The first
.ruby-version
file found by searching the current working directory and each of its parent directories until reaching the root of your filesystem. You can modify the.ruby-version
file in the current working directory with therbenv
local command.The global
~/.rbenv/version
file. You can modify this file using therbenv
global command. If the global version file is not present,rbenv
assumes you want to use the "system" Ruby—i.e. whatever version would be run ifrbenv
weren't in your path.
Você pode usar este comando para criar um arquivo .ruby-version
no diretório junto com o script Ruby.
$ rbenv local 1.9.3-p327