rvm / rvm1-ansible

The official ansible RVM role to install and manage your Ruby versions.
MIT License
271 stars 136 forks source link

Install bundler if not installed - fail #237

Open back2net opened 2 years ago

back2net commented 2 years ago

target host os: Rocky Linux release 8.6 (Green Obsidian)

ansible [core 2.12.3] config file = /home/amfetamin/code/ansible/ansible.cfg configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.10/site-packages/ansible ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections executable location = /home/amfetamin/.local/bin/ansible python version = 3.10.5 (main, Jun 6 2022, 18:49:26) [GCC 12.1.0] jinja version = 3.1.1 libyaml = True

Playbook: become: true remote_user: root gather_facts: yes roles:

TASK [rvm.ruby : Install bundler if not installed] ***** failed: [msc-oxidized-srv01.svetlana-k.ru] (item={'changed': False, 'stdout': '', 'stderr': '', 'rc': 0, 'cmd': '/usr/local/rvm/bin/rvm list strings | grep ruby-2.6-latest | tail -n 1\n', 'start': '2022-07-22 11:49:40.041346', 'end': '2022-07-22 11:49:40.489776', 'delta': '0:00:00.448430', 'msg': '', 'invocation': {'module_args': {'_raw_params': '/usr/local/rvm/bin/rvm list strings | grep ruby-2.6-latest | tail -n 1\n', '_uses_shell': True, 'warn': False, 'stdin_add_newline': True, 'strip_empty_ends': True, 'argv': None, 'chdir': None, 'executable': None, 'creates': None, 'removes': None, 'stdin': None}}, 'stdout_lines': [], 'stderr_lines': [], 'failed': False, 'item': 'ruby-2.6-latest', 'ansible_loop_var': 'item'}) => {"ansible_loop_var": "item", "changed": false, "cmd": "ls /usr/local/rvm/wrappers/ | if ! grep \"^bundler \" ; then /usr/local/rvm/wrappers//gem install bundler ; fi\n", "delta": "0:00:00.008931", "end": "2022-07-22 11:49:42.073161", "item": {"ansible_loop_var": "item", "changed": false, "cmd": "/usr/local/rvm/bin/rvm list strings | grep ruby-2.6-latest | tail -n 1\n", "delta": "0:00:00.448430", "end": "2022-07-22 11:49:40.489776", "failed": false, "invocation": {"module_args": {"_raw_params": "/usr/local/rvm/bin/rvm list strings | grep ruby-2.6-latest | tail -n 1\n", "_uses_shell": true, "argv": null, "chdir": null, "creates": null, "executable": null, "removes": null, "stdin": null, "stdin_add_newline": true, "strip_empty_ends": true, "warn": false}}, "item": "ruby-2.6-latest", "msg": "", "rc": 0, "start": "2022-07-22 11:49:40.041346", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}, "msg": "non-zero return code", "rc": 127, "start": "2022-07-22 11:49:42.064230", "stderr": "/bin/sh: /usr/local/rvm/wrappers//gem: No such file or directory", "stderr_lines": ["/bin/sh: /usr/local/rvm/wrappers//gem: No such file or directory"], "stdout": "", "stdout_lines": []}

thbar commented 2 years ago

FWIW, I have chosen to install bundler myself now, and have shared my experience here https://thibautbarrere.com/2020/09/19/managing-bundler-and-rubygems-with-ansible. Hope this helps!

Unknown-Guy commented 1 year ago

This impacts older Ruby versions now:

bundler requires Ruby version >= 2.6.0. The current ruby version is 2.5.0

So setting specific bundler version would be useful.