在开发中,我们通过.rvmrc 来控制当前目录的 ruby 版本。
当使用 capistrano 部署到服务器上时,由于版本控制 (git, svn) 的原因,在进入/path/to/app/current/目录时,一直会提示下面的信息来让你确认。
==============================================================================
= NOTICE =
==============================================================================
= RVM has encountered a new or modified .rvmrc file in the current directory =
= This is a shell script and therefore may contain any shell commands. =
= =
= Examine the contents of this file carefully to be sure the contents are =
= safe before trusting it! ( Choose v[iew] below to view the contents ) =
==============================================================================
Do you wish to trust this .rvmrc file? (/home/www/apps/current/.rvmrc)
y[es], n[o], v[iew], c[ancel]> n
可以通过下面的配置来解决:
编辑 rvm 配置文件(~/.rvmrc or /etc/rvmrc)
加上下面的一行
rvm_trust_rvmrcs_flag=1