Heray-Was-Here
Server : Apache
System : Linux vps43555.mylogin.co 3.10.0-1160.53.1.vz7.185.3 #1 SMP Tue Jan 25 12:49:12 MSK 2022 x86_64
User : redsea ( 60651)
PHP Version : 7.4.32
Disable Function : NONE
Directory :  /usr/local/rvm/help/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/local/rvm/help/tools.md
    $ rvm tools {identifier,path-identifier,strings,mirror,rvm-env}

Provides generic tools related to rvm environments for gaining information
about your current environment.  Primarily used for scripting rvm.

Examples:

To get the expanded Ruby string for the current environment, you would run:

    $ rvm tools identifier

To get the identifier for a folder (taking into account .rvmrc files and the like),
run this instead:

    $ rvm tools path-identifier ~/path/to/directory

Lastly, you can expand example Ruby strings.  E.g., to get the current ree version,
run:

    $ rvm tools strings ree

In case of network/firewall problems, it is easy to define alternate download URLs:

    $ rvm tools mirror


It is possible to use a "shebang" (#!/usr/...) line to select the interpreter
(eg, Ruby 1.9.3) which processes a script file.  However, this will work only
on recent Linux kernels (2.6.27.9 and above).

First, you need to define the shebang wrapper:

    $ rvm tools rvm-env ruby bash zsh

This will define:

    /usr/bin/{ruby,bash,zsh}-rvm-env

Your scripts can then request the proper Ruby, using shebang:

    #!/usr/bin/ruby-rvm-env 1.9.3

The script will be run using Ruby 1.9.3 from rvm.

Alternatively, here is a hack to make a script switch itself:

    if !ENV['ruby_switch_flag']
      ENV['ruby_switch_flag'] = '42'
      system('rvm', '1.9.3', 'do', __FILE__, *ARGV)
      exit 0
    end


Hry