RVM - Automatically use a certain Ruby version for a given command?

I have some commands that need particular version of Ruby e.g. Chef's knife command seems to work best with 2.0.0 while sup works best with 1.9.2. Is there a way, without writing a wrapper script or manually do "rvm use", that when I execute "sup" it will use 1.9.2 and when I execute knife it will use "2.0.0"?

I realise this question is not strictly "development" but there are lots of RVM questions on SO already so I figured it was a good place to ask.

Upvotes: 1

Views: 72

Answers (1)

mpapis
mpapis

Reputation: 53158

rvm generates wrappers for you:

rvm wrapper 2.0.0 --no-prefix knife
rvm wrapper 1.9.2 --no-prefix sup

assuming you do not install this gems in all rubies the default from $rvm_path/bin/ will be used with loading proper ruby.

Upvotes: 1

Related Questions