DWQA QuestionsCategory: ServerInvalid shell script execution RVM instruction switch version
Dont asked 1 month ago

Environment needs to be used beforeruby 2.0.0, so I installedrvmTo switch versions.
I feel like I have to input it manually every timervm use 2.0.0-p451No, just write the instructions in the shell script. Every time you run the script, you can (in fact, typing a few words less).
But here comes the question:sshLogon
Invalid shell script execution RVM instruction switch version
As shown in the figure, the script is executed without switching the successful version
Script content:
Invalid shell script execution RVM instruction switch version
Is itbash -lcThe problem? But if you write directlyrvm use 2.0.0-p451And I want to use it/bin/bash --login?
Does anyone know this situation? How to solve it? Shell rookie for guidance

1 Answers
Tranch answered 1 month ago

About tips to use/bin/bash --loginSee also:Why do I need to run “/bin/bash –login”, so you can also directly~/.bashrcAccession:

source /etc/profile.d/rvm.sh

Or in a script:

source /etc/profile.d/rvm.sh
rvm --default use 2.0.0-p451
Larvata replied 1 month ago

You don’t have to worry about it. Write the script directlyrvm use 2.0.0-p451Call the script with source when using. ./rvmUse200.sh