为什么RVM在bash脚本中不能像在交互式shell中那样工作? [英] Why doesn't RVM work in a bash script like it works in an interactive shell?
本文介绍了为什么RVM在bash脚本中不能像在交互式shell中那样工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果您在控制台中键入命令,它将起作用.
If you type the command in console, it works.
但是如果将它们放在bash脚本中,就会出现问题.
But if you put them in a bash script, problem comes.
#!/bin/bash
rvm use 1.8.7
rvm list # This shows the ruby used in parent shell's rvm.
推荐答案
在脚本中,您很可能没有将rvm作为函数加载.
In the script you are most likely not loading rvm as a function.
这篇关于为什么RVM在bash脚本中不能像在交互式shell中那样工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文