【问题标题】:Installing Ruby through RVM on Ubuntu 10.04.1 LTS在 Ubuntu 10.04.1 LTS 上通过 RVM 安装 Ruby
【发布时间】:2013-08-16 18:26:10
【问题描述】:

我似乎无法在我的 Ubuntu 10.04.1 LTS 机器上安装 Ruby。我尝试了几个不同的教程,但都没有奏效。看来我可以使用命令\curl -L https://get.rvm.io | bash -s stable 正确安装 RVM。不过,我确实收到了这个警告:

  * WARNING: Your '/root/.bashrc' contains `PATH=` with no `$PATH` inside, this can breakRVM,
  for details check https://github.com/wayneeseguin/rvm/issues/1351#issuecomment-10939525
  to avoid this warning append #PATH.

当我尝试运行 rvm install 1.9.3 时,我得到以下信息并且 ruby​​ 没有安装。

  Downloaded archive checksum did not match, archive was removed!
  If you wish to continue with not matching download add '--verify-downloads 2' after the command.

  There has been an error fetching the ruby interpreter. Halting the installation.

我尝试添加--verify-downloads 2,但也没有用。

我最终想安装 rails 但当然需要先安装 ruby​​。

编辑:
我在尝试安装 ruby​​ 时也会收到 /usr/local/rvm/scripts/functions/support: line 170: cd: /path/to/tarballs/: No such file or directory

【问题讨论】:

    标签: ruby-on-rails ubuntu rvm ubuntu-10.04


    【解决方案1】:

    您似乎错过了将路径添加到.bashrc.bash_profile 中的rvm/bin 目录的步骤。任何一个都可以,这里我使用~/.bashrc。将以下行添加到 ~/.bashrc 的末尾并重新加载 ~/.bashrc 然后试一试。

    # .bashrc
    export PATH=$PATH:/usr/local/rvm/bin # This is default path
    

    重新加载您的~/.bashrc

    $ source ~/.bashrc
    

    【讨论】:

    • 这似乎不起作用。我仍然得到同样的错误。如果您想看一下,我还编辑了我的问题,提供了更多信息。
    【解决方案2】:
    1. 你不应该以 root 身份工作,这是不安全的,你很容易被它咬伤,开始使用用户帐户进行工作/部署。您可以使用以下命令删除当前安装:

      rm -rf /usr/local/rvm /etc/rvmrc /etc/profile.d/rvm.sh
      
    2. 您收到警告是因为在 /root/.bashrc 中有 PATH=... 它打算在那里,您不应该直接使用 root 帐户(看 1。)

    3. 校验和问题:它是由手动下载/构建 ruby​​ 存档引起的,除非您指定标志 (--verify-downloads 2),否则 rvm 将阻止这些问题,这意味着您信任不匹配校验和的存档。
    4. 对于cd 问题:您有一个文件/etc/rvmrc/root/.rvmrc 指定rvm_archives_path=/path/to/tarballs - 确保将其删除(它可能在1 之后已经消失)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-11
      • 2012-02-22
      • 1970-01-01
      • 1970-01-01
      • 2013-02-01
      • 1970-01-01
      相关资源
      最近更新 更多