gpt4 book ai didi

ruby - 多用户安装后 "bash: rvm: command not found"

转载 作者:行者123 更新时间:2023-12-04 19:03:27 25 4
gpt4 key购买 nike

我已按照如何在 Ubuntu 上进行 rvm 的多用户安装的说明进行操作。我没有以 root 身份执行此操作。当我执行“source/etc/profile.d/rvm.sh”时,我可以使用 rvm。但是,如果我注销并再次登录并执行“rvm -v”,我会得到“bash: rvm: command not found”。我可以做到这样我就不必写“source/etc/profile.d/rvm.sh”了吗?

作为名为“user1”的非root用户,我做了:

# multi-user install
\curl -sSL https://get.rvm.io | sudo bash -s stable

# add user1 to rvm group
sudo adduser user1 rvm

source /etc/profile.d/rvm.sh

然后我退出 shell 并开始一个新的:
user1@72265e666e07:/$ rvm -v
bash: rvm: command not found

最佳答案

看看这个 question 的答案:

From your problem description it seems that the rvm script needs to be loaded only once, during login. As far as I know, Ubuntu reads /etc/profile/ and ~/.profile during login (the graphical login, independent of bash). That means, after logging out and a logging in once, the rvm script should be active. If it still doesn't work, then perhaps the rvm script needs to be loaded for every bash session. If that is the case then bashrc is the more appropriate place for the script.

关于ruby - 多用户安装后 "bash: rvm: command not found",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22452256/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com