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, 2019 in Ansible by John
2,097 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, 2019 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 10, 2019 in Ansible by Rishi
2,133 views
0 votes
1 answer

Install ansible galaxy roles

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

answered Jan 10, 2019 in Ansible by Disha
806 views
0 votes
1 answer

Unable to install Ansible on centOS

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

answered Dec 20, 2018 in Ansible by Alan
692 views
0 votes
1 answer

Install Ansible on centOS

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

answered Jan 8, 2019 in Ansible by Kiara
686 views
+15 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 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,036 views
+2 votes
1 answer
+1 vote
2 answers

What is the difference between ansible playbook and roles?

Hi, Roles: Roles containing certain vars_files, tasks, and handlers ...READ MORE

answered Jan 21, 2020 in Ansible by vivek
• 530 points
21,823 views
0 votes
1 answer

Install Ansible on Hp UX

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

answered Jan 10, 2019 in Ansible by Niks
1,578 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP