[英]How to run bundle install with rvm installed using rvm1-ansible role
I installed rvm using rv1-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'
}
Now I would like to run bundle install inside application directory: 现在我想在应用程序目录中运行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
But get error: "/usr/bin/env: 'ruby_executable_hooks': No such file or directory"
但是得到错误:
"/usr/bin/env: 'ruby_executable_hooks': No such file or directory"
Any idea how to do this? 任何想法如何做到这一点?
You need to do a root install - installing as a specific user does not work. 您需要进行root用户安装-以特定用户身份安装无法进行。 Little bit of info why here - Ansible is not logging in to run commands so doesn't pick up user-specific RVM stuff.
此处的少量信息-Ansible未登录以运行命令,因此不会获取用户特定的RVM内容。 By installing globally,
rvm
and bundler
and all the other crap I don't know about which you need on the path is available on the path. 通过全局安装
rvm
和bundler
以及我不知道您需要在路径上使用的所有其他废话,该路径上可用。
Example config installing ruby system wide ripped right from the rvm1-ansible
docs: 从
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.