本文介绍了如何使用shell脚本RVM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是它可以加载RVM在shell脚本。任何一个可以给它的一个例子。
当我尝试一个shell脚本。我使用Ubuntu系统

 #!/斌/庆典
RVM 1.9.3使用

它给我的错误

  RVM不是一个函数,选择具有红宝石RVM使用......将无法工作。你需要改变你的终端仿真器preferences允许登录shell。
有时需要使用`/ bin / bash的--login`的命令。
请访问https://rvm.io/integration/gnome-terminal/一个例子。


解决方案

您可以直接在您的脚本做RVM:

 源〜/ .rvm /脚本/ RVM

然后RVM应提供给你的脚本,

is it possible to load rvm in shell script . can any one give an example of it.when i try a shell script . i am using ubuntu system

#!/bin/bash
rvm use 1.9.3

it gives me error

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 a example.
解决方案

You can just include rvm in your script by doing:

source ~/.rvm/scripts/rvm

then rvm should be available to your script,

这篇关于如何使用shell脚本RVM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 18:21
查看更多