RVM is not a function, selecting rubies with '

2019-01-12 16:31发布

List the ruby versions

console:~$ rvm list

rvm rubies

ruby-2.0.0-p481 [ i686 ]

# => - current
# =* - current && default
#  * - default

Try to use a specific version of ruby

console:~$ rvm use 2.0.0

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.
Sometimes it is required to use `/bin/bash --login` as the command.
Please visit https://rvm.io/integration/gnome-terminal/ for a example.

标签: ruby bash rvm
11条回答
放荡不羁爱自由
2楼-- · 2019-01-12 17:01

From a new Ubuntu 16.04 Installation

1) Terminal => Edit => Profile Preferences

2) Command Tab => Check Run command as a login shell

3) Close, and reopen terminal

rvm --default use 2.2.4
查看更多
Anthone
3楼-- · 2019-01-12 17:02

If you don't want that every time you open a terminal, do the suggestion above again, just add

source ~/.rvm/scripts/rvm

at the end of ~/.bashrc

查看更多
狗以群分
4楼-- · 2019-01-12 17:07

The error is due to rvm is not running as in login shell. Hence try the below command:

/bin/bash --login

You will able run rvm commands instantly as login shell in terminal.

Thanks!

查看更多
成全新的幸福
5楼-- · 2019-01-12 17:11

It seems like your rvm does not load ".bash_profile" properly. I have done to fix it in MAC OS X or Ubuntu 14.04 by opening terminal and write:

source ~/.rvm/scripts/rvm
查看更多
不美不萌又怎样
6楼-- · 2019-01-12 17:13

Type bash --login from your terminal. And then give rvm use 2.0.0

查看更多
霸刀☆藐视天下
7楼-- · 2019-01-12 17:14

Same principle as other answers, just thought it was quicker than re-opening terminals :)

bash -l -c "rvm use 2.0.0"
查看更多
登录 后发表回答