I am trying to install Bundler on my VPS using Ansible.
I already have rbenv set up and the global ruby is 2.1.0.
If I SSH as root into the server and run
I got it working like this:
- name: Install jekyll and bundler
become_user: bob
gem:
name: "{{ item }}"
environment:
GEM_HOME: /home/bob/gems
PATH: $PATH:/bin/:/usr/bin/:/home/bob/gems/bin
with_items:
- jekyll
- bundler
Replace bob with your local user.
And then use the same principle with the bundler module
- name: Install Gems
become_user: bob
bundler:
gemfile: /home/bob/Gemfile
state: present
environment:
GEM_HOME: /home/bob/gems
PATH: $PATH:/bin/:/usr/bin/:/home/bob/gems/bin