gpt4 book ai didi

ruby - 使用 ansible playbook 更改 rvm ruby​​ 版本

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

我已经成功安装了 ansible-playbook rvm。但现在我必须更改默认的 ruby​​ 版本。我试过:

- name: Install Bundler
command: bash -lc "rvm use 2.1.2-p95"

- name: use 2.1
shell: /usr/bin/env bash -lc "rvm use 2.1.2-p95"

- name: use 2.1
shell: rvm use 2.1.2-p95

但是没有任何 ansible 看起来一切正常,但是当我使用同一个用户登录 ssh 时使用 ansible 并运行 rvm current ruby​​ 版本是相同的。

我怀疑来自 ssh 和 bash 登录 shell,但我可以看到解决方案。

最佳答案

尝试:

- name: Install Bundler
command: rvm alias create default ruby-2.1.2-p95

顺便说一句。你见过 RVM 对 Ansible 的支持吗:https://github.com/rvm/rvm1-ansible

关于ruby - 使用 ansible playbook 更改 rvm ruby​​ 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26107254/

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