[英]How to run bundle install with rvm installed using rvm1-ansible role
我使用rv1-ansible角色安装了rvm:
- hosts: all
remote_user: deploy
roles:
- { role: rvm_io.ruby,
tags: ruby,
rvm1_rubies: ['ruby-2.4.0'],
rvm1_user: 'deploy'
}
现在我想在应用程序目录中运行bundle install:
- hosts: all
remote_user: deploy
tasks:
- name: Clone git repository
git:
dest: /home/deploy/public_html/app_name
repo: git@github.com:user/app_name.git
- name: Bundle install
bundler:
state: present
chdir: /home/deploy/public_html/app_name
executable: ~/.rvm/gems/ruby-2.4.0/bin/bundle
但是得到错误: "/usr/bin/env: 'ruby_executable_hooks': No such file or directory"
任何想法如何做到这一点?
您需要进行root用户安装-以特定用户身份安装无法进行。 此处的少量信息-Ansible未登录以运行命令,因此不会获取用户特定的RVM内容。 通过全局安装rvm
和bundler
以及我不知道您需要在路径上使用的所有其他废话,该路径上可用。
从rvm1-ansible
文档中rvm1-ansible
示例安装红宝石系统的配置文件:
- name: Configure servers with ruby support system wide
hosts: all
roles:
- { role: rvm_io.ruby,
tags: ruby,
become: yes,
rvm1_rubies: ['ruby-2.2.5','ruby-2.3.1'],
rvm1_install_flags: '--auto-dotfiles', # Remove --user-install from defaults
rvm1_install_path: /usr/local/rvm, # Set to system location
rvm1_user: root # Need root account to access system location
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.