【问题标题】:RVM asks for passwordRVM 要求输入密码
【发布时间】:2022-01-11 15:02:12
【问题描述】:

我正在尝试使用 rvm 安装 ruby​​。

我正在安装的用户是go

[go@ci-qa1 ~]$ whoami
go

我最初获取密钥 -

curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
gpg: key D39DC0E3: "Michal Papis (RVM signing) <mpapis@gmail.com>" not changed
gpg: Total number processed: 1
gpg:              unchanged: 1
(honeymaker_venv) [go@ci-qa1 ~]$ curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import -
gpg: key 39499BDB: "Piotr Kuczynski <piotr.kuczynski@gmail.com>" not changed
gpg: Total number processed: 1
gpg:              unchanged: 1

并用于安装 -

curl -sSL https://get.rvm.io | bash -s stable --ruby
Downloading https://github.com/rvm/rvm/archive/1.29.12.tar.gz
Downloading https://github.com/rvm/rvm/releases/download/1.29.12/1.29.12.tar.gz.asc
gpg: Signature made Sat 16 Jan 2021 12:16:22 AM IST using RSA key ID 39499BDB
gpg: Good signature from "Piotr Kuczynski <piotr.kuczynski@gmail.com>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 7D2B AF1C F37B 13E2 069D  6956 105B D0E7 3949 9BDB
GPG verified '/home/go/.rvm/archives/rvm-1.29.12.tgz'
Upgrading the RVM installation in /home/go/.rvm/
    RVM PATH line found in /home/go/.mkshrc /home/go/.profile /home/go/.zshrc.
    RVM PATH line not found for Bash, rerun this command with '--auto-dotfiles' flag to fix it.
    RVM sourcing line found in /home/go/.profile /home/go/.zlogin.
    RVM sourcing line not found for Bash, rerun this command with '--auto-dotfiles' flag to fix it.
Upgrade of RVM in /home/go/.rvm/ is complete.

Thanks for installing RVM ????
Please consider donating to our open collective to help us maintain RVM.

????  Donate: https://opencollective.com/rvm/donate


Ruby enVironment Manager 1.29.12 (latest) (c) 2009-2020 Michal Papis, Piotr Kuczynski, Wayne E. Seguin

Searching for binary rubies, this might take some time.
No binary rubies available for: centos/7/x86_64/ruby-3.0.0.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for centos.
Installing requirements for centos.
Installing required packages: ruby...go password required for 'yum install -y ruby': 

为什么要输入密码?我已经阅读了多个 pther stackoverflow 答案,说不要以 root 身份安装。我该如何解决这个问题?

如果我禁用自动库 -

Checking requirements for centos.
Missing required packages: ruby
RVM autolibs is now configured with mode '2' =>
  'Allow RVM to use package manager if found, fail if dependencies are missing. This is default.',
please run `rvm autolibs enable` to let RVM do its job or run and read `rvm autolibs [help]`
or visit https://rvm.io/rvm/autolibs for more information.
Requirements installation failed with status: 1.

【问题讨论】:

    标签: ruby-on-rails ruby rvm


    【解决方案1】:

    我们有 3 种方法将 ruby​​ 安装到 centOS 中

    1. 从 YUM 包管理器安装 Ruby。
    2. 使用 rvm 安装 Ruby。
    3. 使用 rbenv 安装 Ruby。

    您收到错误是因为安装 rvm 需要最低限度的 ruby​​(还有签名问题)。

    使用 rvm 将 ruby​​ 安装到 centOs 的依赖项很少。 在安装rvm之前,请确保您已经安装了所有这些依赖项。

    sudo yum install ruby git libreadline-dev zlib1g-dev libreadline-dev libncurses5-dev autoconf bison libssl-dev build-essential libyaml-dev libffi-dev libssl-dev libreadline-dev zlib1g-dev libgdbm-dev
    

    如果您仍然遇到任何错误,请告诉我。

    【讨论】:

    • 如果我使用 yum 安装 ruby​​ 为什么我需要使用 rvm 再次安装它? rvm 需要 ruby​​ 才能安装 ruby​​ 是没有意义的。我只是询问,因为我已经阅读了很多文档说 nto to isntall ruby​​ with sudo。
    • rvm 是一个版本管理工具。它提供了一种非常简单的方法来拥有多个 ruby​​ 和 rails 版本。因此,您可以拥有不同的 ruby​​ 和 rails 版本,并且可以非常快速地进行更改。
    • 我尝试单独安装它们。没有安装 ruby​​ 的 Rvm。但是rvm install ruby 也要求输入密码。现在有没有办法在没有 sudo 的情况下安装 ruby​​ ?
    • 哦,我明白了。为此,您必须禁用 autolibs。试试这个rvm autolibs disable 然后使用 rvm 安装 ruby​​。
    • 试过了。没用。添加了错误的编辑
    【解决方案2】:

    由于某种原因,如果我禁用 autolibs 并运行它会失败并出现问题中提到的错误。但是如果我用这个命令运行它

    curl -L get.rvm.io | bash -s -- --ignore-dotfiles --autolibs=0 --ruby
    

    我假设它会同样禁用自动库,它可以工作。

    注意:由于我认为 autolib 禁用,上述命令不会在 bash 中设置 rvm。所以这一步必须手动完成。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-30
      • 2014-04-26
      • 2012-04-02
      • 2013-03-17
      • 2013-08-29
      • 1970-01-01
      相关资源
      最近更新 更多