致力于此项目: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/