Reputation: 2253
I'm executing a call to rvm use ...
from inside a Ruby script:
system "rvm use 2.5.5"
When the above executes, I get
RVM is not a function, selecting rubies with 'rvm use ...' will not work.
You need to change your terminal emulator preferences to allow login shell.
I'm fairly sure that I'm logged in as a login shell. There's no problem using normal RVM commands in the terminal I have open. Does the system
command pick up on the current shell or does it use something else by default? If it uses something else, what's the best way to get Ruby to run a command in the context of the current shell?
Upvotes: 0
Views: 397
Reputation: 2144
These things can be tricky with RVM. Try this:
"/bin/bash -c -l 'rvm use 2.5.5 && <add your system commands here>'"
Note: I guess it would create a new shell environment. Do you really need to access your current shell?
Upvotes: 2