更新新的 Ruby 版本时出现问题



我尝试在我的Mac上安装一个新的带有rvm的Ruby版本。我选择重新安装所有内容有几个问题。

红宝石有两种版本。

  1. Mac 内部红宝石 -> 1.8.*
  2. 用户版本-> 1.9.1(需要>= 1.9.2)

可以使用"sudo rvm install ..." 在本地 mac 版本上安装新版本但是当我使用我的用户版本尝试时,会出现此错误:

stvn$ rvm install 1.9.2
info: Installing Ruby from source to: /Users/stvn/.rvm/rubies/ruby-1.9.2-p0
info: Downloading ruby-1.9.2-p0, this may take a while depending on your connection...
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                               Dload  Upload   Total   Spent    Left  Speed
100 8296k  100 8296k    0       139k      0  0:00:59  0:00:59   --:--:--  102k
info: Extracting ruby-1.9.2-p0 ...
info: Applying patch '' (located at /)
error: Error running 'patch -F25 -p1 -f <"/"', please check /Users/stevenklar/.rvm/log/ruby-1.9.2-p0/patch.apply.*.log
fail: There has been an error applying the specified patches. Aborting the installation.

已经尝试了在stackoverflow和google中发布的几种解决方案。什么都没用。这些错误似乎与无用有关。路径。意味着 rvm 使用"作为路径,而不是例如"/Users/stvn/.rvm/..."

有人知道如何解决吗?

您有两个版本的 RVM,一个在系统中(1.12.2 - 几乎是新的),另一个在用户主页(1.0.2 - 古代)。

由于建议用户安装,因此您应该删除所有内容并重新开始:

sudo rm -rf /usr/local/rvm /etc/rvmrc /etc/profile.d/rvm.sh ~/.rvm*

打开新终端并确保环境中没有 RVM:

env | grep rvm

输出应为空,如果不重新启动计算机,

最后,以用户身份运行安装程序,无需 sudo:

curl -L get.rvm.io | bash -s stable --auto

您也可以在引导模式下安装,要求使用 Ruby 1.9.2:

curl -L get.rvm.io | bash -s stable --auto --ruby=1.9.2

"在本地Mac版本上安装新版本"是什么意思?

老实说,我刚刚删除了我提供的 ruby 版本并安装了 rvm。

此外,您应该始终使用 rvmsudo ,而不是 sudo rvm

sudo install patch

请查看此帖子,并按照所有说明进行操作:

红宝石安装问题

安装所需的所有软件包。

rvm 也不需要 sudo

最新更新