# Issue with Ruby version on target system

**URL:** <https://forum.ansible.com/t/issue-with-ruby-version-on-target-system/38274>\
**Category:** Ansible Project\
**Tags:** rhel\
**Created:** [July 28, 2023, 7:31pm UTC](https://forum.ansible.com/t/issue-with-ruby-version-on-target-system/38274 "2023-07-28T19:31:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![harry\_devine](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/harry_devine/32/5293_2.png) [@harry\_devine](https://forum.ansible.com/u/harry_devine)\
**Post date:** [July 28, 2023, 7:31pm UTC](https://forum.ansible.com/t/issue-with-ruby-version-on-target-system/38274/1 "2023-07-28T19:31:44Z")

</div>

I have a role that will install Redmine onto a RHEL 8 system. When I run the playbook and it tries to install “bundler”, I get the following error:

ERROR: Error installing bundler:  
bundler requires Ruby version \>= 2.6.0. The current ruby version is 2.5.0.

I have installed Ruby 2.7.8 on the target system using rvm, but I still get that error. How can I have the playbook recognize that Ruby 2.7.8 is installed and the default to eliminate this error?

Thanks,  
Harry

---

<div class="post-metadata">

**Author:** ![dnmvisser](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dnmvisser](https://forum.ansible.com/u/dnmvisser)\
**Post date:** [July 28, 2023, 9:56pm UTC](https://forum.ansible.com/t/issue-with-ruby-version-on-target-system/38274/2 "2023-07-28T21:56:55Z")

</div>

Without seeing any tasks or plays that would be hard.

---

<div class="post-metadata">

**Author:** ![harry\_devine](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/harry_devine/32/5293_2.png) [@harry\_devine](https://forum.ansible.com/u/harry_devine)\
**Post date:** [July 30, 2023, 12:31am UTC](https://forum.ansible.com/t/issue-with-ruby-version-on-target-system/38274/3 "2023-07-30T00:31:08Z")

</div>

Here’s the section of the role:

- name: Install latest Bundler gem  
ansible.builtin.gem:  
name: bundler  
state: present  
user\_install: false  
executable: /bin/gem  
changed\_when: false

Thanks,  
Harry

---

<div class="post-metadata">

**Author:** ![rilindo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/rilindo/32/357_2.png) [@rilindo](https://forum.ansible.com/u/rilindo)\
**Post date:** [July 31, 2023, 2:49pm UTC](https://forum.ansible.com/t/issue-with-ruby-version-on-target-system/38274/4 "2023-07-31T14:49:02Z")

</div>

Being somewhat familiar with rvm, has the gem binary been (sym)linked to the version of ruby deployed with rvm? Alternatively, you can probably set the executable attribute to point to an explicit path of the gem binary (as opposed to defaulting to /bin/gem)
