Run bundle install inside rvm - Ansible roles

0 votes

I've installed rvm using an Ansible role. now I'm trying to run install bundle inside application directory. But I get the following error:

"/usr/bin/env: 'ruby_executable_hooks': No such file or directory"

role to install rvm

- hosts: all
  remote_user: deploy

  roles:
    - { role: rvm_io.ruby,
        tags: ruby,
        rvm1_rubies: ['ruby-2.4.0'],
        rvm1_user: 'deploy'
      }

Role to run install bundle 

- 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
Mar 13 in Ansible by John
107 views

1 answer to this question.

0 votes

Example config installing ruby system-wide ripped right from the rvm-ansible docs:

- 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
      }
answered Mar 13 by Kim

Related Questions In Ansible

0 votes
1 answer

Install multiple roles - Ansible

You'll need a requirements.yaml file which will ...READ MORE

answered Jan 9 in Ansible by Rishi
196 views
0 votes
1 answer

Install ansible galaxy roles

Here is a very basic example that ...READ MORE

answered Jan 9 in Ansible by Disha
57 views
0 votes
1 answer

Unable to install Ansible on centOS

Seems like you're stuck at creating ansible ...READ MORE

answered Dec 19, 2018 in Ansible by Alan
24 views
0 votes
1 answer

Install Ansible on centOS

Hey @Ali, Installing Ansible is a piece ...READ MORE

answered Jan 8 in Ansible by Kiara
34 views
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
111 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Install Ansible on Hp UX

Hey @Diana, You cannot use HP -UX as ...READ MORE

answered Jan 10 in Ansible by Niks
134 views