• Rvm 进行gem安装时必须输入密码Your user account isn't allowed to install to the system RubyGems 解决方案


    今天开发过程中,从master拉下代码后重启项目,想用控制台时,却发现需要密码??并且三次密码确认后还是疯狂报错。

    当时第一想到是rvm版本不一致,随即则检查了版本跟gem生成,当确认rvm版本无误时,且强制使用sudo安装却需要一条条执行gem install ***安装gem包时,就令我抓狂了。

    警告提示如下:

    Your user account isn't allowed to install to the system RubyGems.
    You can cancel this installation and run:
    
    bundle install --path vendor/bundle
    
    to install the gems into ./vendor/bundle/, or you can enter your password
    and install the bundled gems to RubyGems using sudo.

    或者如下:

    RVM is not a function, selecting rubies with 'rvm use ...' will not work.
    
    You need to change your terminal emulator preferences to allow login shell.
    Sometimes it is required to use `/bin/bash --login` as the command.
    Please visit https://rvm.io/integration/gnome-terminal/ for an example.
    

    猜测原因:

         rbenv 要往你系统的自带Ruby里面安装gem,但是你的用户帐户不允许系统安装RubyGems,所以要你输入密码赋予权限

    解决方案(控制台依次输入):

    1 echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"' >>~/.bashrc
    2 
    3 source ~/.bashrc
    4 
    5 ruby -v

    然后就解决了,可以继续嗨皮开发了!!

  • 相关阅读:
    redis从入门到放弃 -> 数据持久化
    yum怎么用?
    centos7.2系统没有eth0网卡
    redis从入门到放弃 -> 部署方案
    redis从入门到放弃 -> 简介&概念
    mysql用户权限设置
    mysql安装注意
    解决windows下的mysql匿名登陆无法使用mysql数据库的问题
    参数化测试--sheet表的应用
    整理QTP知识之1
  • 原文地址:https://www.cnblogs.com/lwh-note/p/10208274.html
Copyright © 2020-2023  润新知