Ruby on rails 使用vagrant使用railsbox部署ruby/rbenv时出错

Ruby on rails 使用vagrant使用railsbox部署ruby/rbenv时出错,ruby-on-rails,ruby,vagrant,ansible,Ruby On Rails,Ruby,Vagrant,Ansible,我使用railbox创建了一个可以通过vagrant部署的。 但是,安装程序因以下错误而停止 ==> myapp: fatal: [127.0.0.1]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'ansible.vars.unsafe_

我使用railbox创建了一个可以通过vagrant部署的。 但是,安装程序因以下错误而停止

==> myapp: fatal: [127.0.0.1]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'ansible.vars.unsafe_proxy.AnsibleUnsafeText object' has no attribute 'git'\n\nThe error appears to have been in '/ansible/roles/ruby/tasks/rbenv.yml': line 15, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Install plugins\n  ^ here\n"}
rbenv.yml的内容:

---
- name: Install libffi-dev
  apt: name=libffi-dev

- name: Clone rbenv repository to ~/.rbenv
  git: repo={{ rbenv_repo }} dest={{ rbenv_path }} version={{ rbenv_version }} accept_hostkey=yes
  sudo_user: '{{ user_name }}'

- name: Create rbenv.sh
  template: src=rbenv.sh.j2 dest={{ profile_d_path }}/rbenv.sh owner={{ user_name }} group={{ group_name }}

- name: Create plugins directory
  file: path={{ rbenv_plugins_path }} state=directory owner={{ user_name }} group={{ group_name }}

- name: Install plugins
  git: repo={{ item.git }} dest={{ rbenv_plugins_path }}/{{ item.name }} version={{ item.version }} accept_hostkey=yes
  sudo_user: '{{ user_name }}'
  with_items: rbenv_plugins

- name: Check if ruby installed
  shell: '{{ rbenv_bin }} versions | grep -q {{ rbenv_ruby_version }}'
  register: ruby_installed
  ignore_errors: yes
  sudo_user: '{{ user_name }}'

- name: Install ruby
  command: '{{ rbenv_bin }} install {{ rbenv_ruby_version }}'
  sudo_user: '{{ user_name }}'
  when: ruby_installed|failed

- name: Set global ruby version
  command: '{{ rbenv_bin }} global {{ rbenv_ruby_version }}'
  sudo_user: '{{ user_name }}'

- name: Rehash rbenv
  command: '{{ rbenv_bin }} rehash'
  sudo_user: '{{ user_name }}'

yml文件有什么问题?

如果运行Ansible的最新版本(我相信它已更改为2.2版),则需要使用jinja2语法编写

- name: Install plugins
  git: repo={{ item.git }} dest={{ rbenv_plugins_path }}/{{ item.name }} version={{ item.version }} accept_hostkey=yes
  sudo_user: '{{ user_name }}'
  with_items: '{{ rbenv_plugins }}'