我们使用
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
问候,
菲尔