gpt4 book ai didi

ruby - 我如何在 Makefile 中使用 rvm?

转载 作者:数据小太阳 更新时间:2023-10-29 08:39:16 26 4
gpt4 key购买 nike

从事此项目:https://github.com/cucumber/bool

有一个 makefile 来构建各种项目,我想使用 RVM 来为 ruby​​ 目录中的东西在 rubies 之间切换,但是,当我给出 makefile 命令来切换 rubies 时,我得到一个讨厌的错误

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.

当然,如果我在命令行上发出 rvm use 1.9.3 就可以正常工作,所以这是其他问题的征兆,但我不确定是什么。

最佳答案

当您从 cron(或我希望的 Makefile)调用 RVM 时,设置正确的环境很重要。 Scout 团队有一篇很棒的博客文章对此进行了解释:

http://blog.scoutapp.com/articles/2010/09/07/rvm-and-cron-in-production

重要的部分是确保您拥有完整的登录 shell,以便您可以访问 RVM。

/bin/bash -l -c 'the_command_inside_makefile"

关于ruby - 我如何在 Makefile 中使用 rvm?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14675563/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com