【问题标题】:running into issues with RVM during Ruby install (1.9.2)在 Ruby 安装期间遇到 RVM 问题 (1.9.2)
【发布时间】:2011-11-30 03:12:01
【问题描述】:

我正在尝试通过 RVM 安装 ruby​​,但出现以下错误,日志并不清楚发生了什么,有人遇到过这种情况吗?我似乎记得 Ruby 不应该以 root 身份安装,但我有点怀疑我得到的权限错误。

**Installing Ruby from source to: /Users/mark/.rvm/rubies/ruby-1.9.2-p290, this may take a while depending on your cpu(s)...
ruby-1.9.2-p290 - #fetching 
ruby-1.9.2-p290 - #downloading ruby-1.9.2-p290, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0Warning: Failed to create the file ruby-1.9.2-p290.tar.bz2: Permission denied
  0 8604k    0 16150    0     0  14980      0  0:09:48  0:00:01  0:09:47 26562
curl: (23) Failed writing body (0 != 16150)
ERROR: There was an error, please check /Users/mark/.rvm/log/ruby-1.9.2-p290/*.log. Next we'll try to fetch via http.
Trying http:// URL instead.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0Warning: Failed to create the file ruby-1.9.2-p290.tar.bz2: Permission denied
  0 8604k    0 16150    0     0  24640      0  0:05:57 --:--:--  0:05:57 28333
curl: (23) Failed writing body (0 != 16150)
ERROR: There has been an error while trying to fetch the source.  
Halting the installation.
ERROR: There has been an error fetching the ruby interpreter. Halting the installation.**

【问题讨论】:

  • 如果您将控制台输出格式化为代码示例,我们会更容易阅读。

标签: ruby ruby-1.9.2 failed-installation


【解决方案1】:

我有同样的错误消息,我通过执行sudo chown -R user:user /usr/local/rvm 解决了它,其中user 是您的登录用户,之后我运行 rvm install 1.9.2 并成功完成。

【讨论】:

  • 也许更好的方法是确保您当前的用户是rvm 组的一部分。这样,您就不会弄乱 rvm 目录的权限。只需运行sudo adduser <username> rvm
  • 我尝试运行 sudo adduser rvm 但似乎没有用.. chown 做到了。
  • 如果您要将目录分配给单个用户,只需在单用户模式下安装 rvm。
【解决方案2】:

我喜欢上面的解决方案,但不使用 user:user do user:rvm。

【讨论】:

    【解决方案3】:

    确保您已将用户添加到 rvm 组。另外,请确保您注销并登录。组成员身份在登录时处理,因此为了写入 /usr/local/rvm,您必须先注销然后登录,以便操作系统识别您在rvm 组。

    【讨论】:

    • 尽管尝试使用 source 重新加载我的 shell 并验证我是否在 rvm 组中,但我必须登录和注销才能使其工作。谢谢!
    【解决方案4】:

    错误似乎是

    Failed to create the file ruby-1.9.2-p290.tar.bz2: Permission denied
    

    您是否曾经尝试过使用 sudo 做某事?您要确保 /Users/mark/.rvm/rubies/ 对您的用户是可写的。

    【讨论】:

    • 权限目前是 drwxr-xr-x 4 标记人员 136 Jul 22 22:39 rubies 他们应该是什么?我想我可能曾经错误地将 rvm 安装为 root ...
    • 似乎是对的,/Users/mark/.rvm/log/ruby-1.9.2-p290/*.log 中是否有更多信息说明哪些文件无法写入?
    • 遗憾的是,根本没有日志。这有点奇怪,对吧?
    • 该目录的权限是什么?在不小心使用 sudo 后,我过去做过的一件事就是吹走 ~/.rvm 并重新开始。
    • drwxr-xr-x 4 标记人员 136 Jul 22 22:39 我要尝试吹走 ~./rvm 并再次卷曲 RVM...
    【解决方案5】:

    对于现在进来的开发者,如果你使用的是多模式rvm安装,记得像这样将当前用户添加到rvm组

    rvm group add rvm $USER

    【讨论】:

      猜你喜欢
      • 2023-03-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-18
      相关资源
      最近更新 更多