2

我知道其他人在安装 RVM 时遇到了问题,但我调查了他们的问题/答案,但没有帮助。我正在使用 Ubuntu 11.10,并遵循此处的快速安装说明:https ://rvm.beginrescueend.com/rvm/install/

第一步效果很好:

    ~$ bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
Downloading RVM from wayneeseguin branch stable
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   125  100   125    0     0    909      0 --:--:-- --:--:-- --:--:--  1524
100  799k  100  799k    0     0  1059k      0 --:--:-- --:--:-- --:--:-- 1059k

Upgrading the RVM installation in /home/nsmith/.rvm/
    RVM sourcing line found in: /home/nsmith/.bash_history.

Upgrade Notes:

  * No new notes to display.

# RVM:  Shell scripts enabling management of multiple ruby environments.
# RTFM: https://rvm.beginrescueend.com/
# HELP: http://webchat.freenode.net/?channels=rvm (#rvm on irc.freenode.net)
# Screencast: http://screencasts.org/episodes/how-to-use-rvm

# In case of any issues read output of 'rvm requirements' and/or 'rvm notes'

Upgrade of RVM in /home/nsmith/.rvm/ is complete.

# nsmith,
#
#   Thank you for using RVM!
#   I sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne

迷人的。第 2 步也运行良好,没有输出。第 3 步返回:

The program 'rvm' is currently not installed.  You can install it by typing:
sudo apt-get install ruby-rvm

据我所知,这可能是因为我最初尝试使用 sudo 的第一步,然后把所有事情都搞砸了。我可能会通过上钩和安装来进一步搞砸事情sudo apt-get install ruby-rvm,这显然已经过时或损坏了。

寻找答案导致我:

http://beginrescueend.com/support/troubleshooting/

我在哪里执行了“如何从我的系统中彻底清除所有 RVM 痕迹,包括系统范围的安装?”部分中概述的 .sh 文件。我还按照说明检查了 .bashrc、.bash_profiles、.profiles 等是否有 rvm 提及并删除了它们。

我还尝试了在 StackOverflow 问题“如何在 ubuntu 上卸载 Ruby?”中找到的答案。即,sudo aptitude purge ruby然后,因为我实际上还没有红宝石,sudo aptitude purge ruby-rvm. 我也试过sudo apt-get purge ruby-rvm

最后,我尝试了@mkoby.com 上题为“完全移除-rvm”的说明。这基本上是说删除 .rvm* 文件并运行sudo groupdel rvm

我已经尝试了很多从我的系统中删除 rvm 以便我可以运行全新安装,而不需要 sudo,并最终让事情顺利进行。有人有建议吗?我真的很感激。

4

4 回答 4

7

修复一次:

$ source ~/.profile
$ rvm

正如 gotqn 所说,要始终修复它,您可以将其添加到 ~/.bash_profile 的末尾

$ echo ". .profile" >> ~/.bash_profile
于 2012-02-10T08:49:57.977 回答
4

我正在写这个答案,因为没有直接的答案已经给出了使 rvm 开箱即用而不会再次出现任何问题的答案。Coren 的回答有点像临时解决方案。

全新安装 RVM 后,只需在~/.bash_profile.

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

.bash_profile如果文件不存在,则创建文件。该说明实际上是 RVM 安装手册的一部分,我们希望这样做以完成安装。

我之前也遇到过同样的问题,之后它应该可以正常工作——前提是你之前没有搞砸过 shell/bash 设置(足够)。

此外,$HOME如果您想这样,您可以将 更改为您的主目录的位置:/home/ur_username_here,即使这样脚本也应该可以正常工作。

之后,为了确保关闭该终端并再次打开它。

rvm list通过使用或类似的东西来测试 RVM 是否工作正常。它应该可以正常工作。

于 2013-03-03T23:02:03.347 回答
3

您在不同的文件中有 rvm 采购行。

RVM sourcing line found in: /home/nsmith/.bash_history.

它应该在 .bash_profile 或 .bashrc 文件中。确保自动加载这些文件

解决运行:

~/.rvm/bin/rvm get head --auto

此外,您可能需要设置一些设置,尤其是这可能很重要:https ://rvm.beginrescueend.com/integration/gnome-terminal/

于 2012-02-10T09:18:42.523 回答
0

我也为此苦苦挣扎。对我来说,归结为$PATHshell 中的变量。

我几乎遵循了您在尝试获得 rvm 干净机器时所做的所有相同资源。每当我尝试使用非 sudo 安装运行 RVM 时,我都会收到与您相同的消息:

"The program 'rvm' is currently not installed.  You can install it by typing:
sudo apt-get install ruby-rvm"

此消息并不是真正的错误。它是一个名为 rvm 的文件中的一个脚本,上面写着:

echo "The program 'rvm' is currently not installed.  You can install it by typing:
sudo apt-get install ruby-rvm"

我希望我能记住这个文件的位置,但我不能。(尝试该$ which rvm命令并确认您看到了一个rvm命令,并且它只是上面提到的脚本。)我知道您当前的 bash$PATH将您带到此脚本,而不是真正安装 RVM 的位置。这是获得该确切错误消息的唯一可能方法。

如果你安装了没有 . 的 RVM sudo,它应该在 ~/.rvm (你的主目录中的一个隐藏目录)。如果你$PATH的设置正确,它会在这个目录中寻找 RVM,它会找到它。如果我没记错的话,我必须向上移动到我的变量/home/my_name/.rvm/的开头来创建它,这样命令就会在那里找到 rvm 而找不到上面提到的脚本文件。$PATHrvm

希望这可以帮助你。

于 2012-02-10T08:11:57.970 回答