简体   繁体   中英

Ruby installed via rvm, but ruby -v not working

I've installed Ruby via RVM in my virtual machine.

When I run rvm list I have Ruby 2.1.1 listed as both current and default. But when I run ruby -v my terminal tells me that ruby is not installed, and that I can install Ruby via apt-get .

What am I doing wrong?

You might not be using the login shell . That could be the possible reason why you are unable to select ruby 2.1.1 . Also, you won't have ruby installed in your system (not using RVM), that's why it is telling to install ruby.

Just reopen another terminal and try the below command from terminal and from your project folder to enter in to the log in shell (normally bash profile):

/bin/bash --login

After that, just run

rvm use ruby-2.1.1

You don't need to run this command every time you take the terminal. But, for that please refer this SO answer .

Hope it helps :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM