加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – 是否可以跳过.rvmrc确认?

发布时间:2020-12-13 18:32:52 所属栏目:Linux 来源:网络整理
导读:我们使用 RVM来管理Ruby安装和环境. 通常我们使用这个.rvmrc脚本: #!/bin/bashif [ ! -e '.version' ]; then VERSION=`pwd | sed 's/[a-z/-]//g'` echo $VERSION .version rvm gemset create $VERSIONfiVERSION=`cat .version`rvm use 1.9.2@$VERSION 此脚
我们使用 RVM来管理Ruby安装和环境.

通常我们使用这个.rvmrc脚本:

#!/bin/bash
if [ ! -e '.version' ]; then
  VERSION=`pwd | sed 's/[a-z/-]//g'`
  echo $VERSION > .version
  rvm gemset create $VERSION
fi
VERSION=`cat .version`
rvm use 1.9.2@$VERSION

此脚本强制RVM为每个项目/版本创建新的gem环境.

但每次我们部署新版本时,RVM都会要求我们确认新的.rvmrc文件.

当我们第一次cd到这个目录时,我们得到的结果如下:

  ===============================================================
  = NOTICE:                                                     =
  ===============================================================
  = RVM has encountered a not yet trusted .rvmrc file in the    =
  = current working directory which may contain nasty code.     =
  =                                                             =
  = Examine the contents of this file to be sure the contents   =
  = are good before trusting it!                                =
  =                                                             =
  = Press 'q' to exit the reader when finished reading the file =
  ===============================================================

  (press enter to continue when ready)

这对于开发环境来说并不是那么糟糕,但是对于自动部署,它需要手动确认每个服务器上的每个新版本.

是否可以跳过此确认?

解决方法

我在Waynes blog,http://wayneeseguin.beginrescueend.com/上找到了这些笔记

基本上,添加:

export rvm_trust_rvmrcs_flag=1

到?/ .rvmrc将绕过检查.

还有rvm rvmrc< command> [dir]用于手动信任/取消.rvmrc文件.

寻找同样的事情,以为我会发布解决方案.

HTH

问候,

菲尔

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读