Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby 3.0.0 is not installing #229

Closed
suryart opened this issue Oct 19, 2021 · 4 comments
Closed

Ruby 3.0.0 is not installing #229

suryart opened this issue Oct 19, 2021 · 4 comments

Comments

@suryart
Copy link

suryart commented Oct 19, 2021

I am using Debian 10 buster ec2 machines for running the task:

- name: Provision Web server
  hosts: web
  strategy: free

  roles:
    - {
        role: rvm.ruby,
        tags: ['ruby'],
        become: yes,

        # rvm1_install_flags: '--auto-dotfiles',     # Remove --user-install from defaults
        # rvm1_install_path: /usr/local/rvm,         # Set to system location
        rvm1_install_flags: '--auto-dotfiles --user-install',
        rvm1_install_path: '/home/{{ deploy_user }}/.rvm',
        rvm1_rubies: ['ruby-3.0.0'],
        rvm1_user: "{{ deploy_user }}",
        # rvm1_user: "{{ root_user }}",                          # Need root account to access system location
        rvm1_rvm_version: 'stable',
        become: true
      }

When I run this I get the following error:

failed: [hostname-1] (item={'changed': False, 'end': '2021-10-19 18:58:16.774303', 'stdout': '', 'cmd': ['/home/app/.rvm/bin/rvm', 'ruby-3.0.0', 'do', 'true'], 'failed': False, 'delta': '0:00:00.332979', 'stderr': 'Ruby ruby-3.0.0 is not installed.', 'rc': 2, 'invocation': {'module_args': {'creates': None, 'executable': None, '_uses_shell': False, 'strip_empty_ends': True, '_raw_params': '/home/app/.rvm/bin/rvm ruby-3.0.0 do true', 'removes': None, 'argv': None, 'warn': False, 'chdir': None, 'stdin_add_newline': True, 'stdin': None}}, 'start': '2021-10-19 18:58:16.441324', 'msg': 'non-zero return code', 'stdout_lines': [], 'stderr_lines': ['Ruby ruby-3.0.0 is not installed.'], 'failed_when_result': False, 'item': 'ruby-3.0.0', 'ansible_loop_var': 'item'}) => {"ansible_loop_var": "item", "changed": true, "cmd": ["/home/app/.rvm/bin/rvm", "install", "ruby-3.0.0"], "delta": "0:00:04.674070", "end": "2021-10-19 18:58:21.751280", "item": {"ansible_loop_var": "item", "changed": false, "cmd": ["/home/app/.rvm/bin/rvm", "ruby-3.0.0", "do", "true"], "delta": "0:00:00.332979", "end": "2021-10-19 18:58:16.774303", "failed": false, "failed_when_result": false, "invocation": {"module_args": {"_raw_params": "/home/app/.rvm/bin/rvm ruby-3.0.0 do true", "_uses_shell": false, "argv": null, "chdir": null, "creates": null, "executable": null, "removes": null, "stdin": null, "stdin_add_newline": true, "strip_empty_ends": true, "warn": false}}, "item": "ruby-3.0.0", "msg": "non-zero return code", "rc": 2, "start": "2021-10-19 18:58:16.441324", "stderr": "Ruby ruby-3.0.0 is not installed.", "stderr_lines": ["Ruby ruby-3.0.0 is not installed."], "stdout": "", "stdout_lines": []}, "msg": "non-zero return code", "rc": 1, "start": "2021-10-19 18:58:17.077210", "stderr": "No binary rubies available for: debian/10/x86_64/ruby-3.0.0.\nContinuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.\nError running 'requirements_debian_update_system ruby-3.0.0',\nplease read /home/app/.rvm/log/1634669901_ruby-3.0.0/update_system.log\nRequirements installation failed with status: 1.", "stderr_lines": ["No binary rubies available for: debian/10/x86_64/ruby-3.0.0.", "Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.", "Error running 'requirements_debian_update_system ruby-3.0.0',", "please read /home/app/.rvm/log/1634669901_ruby-3.0.0/update_system.log", "Requirements installation failed with status: 1."], "stdout": "Searching for binary rubies, this might take some time.\nChecking requirements for debian.\nInstalling requirements for debian.\nUpdating system....", "stdout_lines": ["Searching for binary rubies, this might take some time.", "Checking requirements for debian.", "Installing requirements for debian.", "Updating system...."]}

Any idea of what is going wrong here?

@suryart
Copy link
Author

suryart commented Oct 20, 2021

FWIW, this works only with root user access but not the non-sudo(deploy user).
Workaround: I am currently changing the ownership to the deploy user later after rvm.ruby:

- name: Provision Web server
  hosts: web
  strategy: free

  roles:
    - {
        role: rvm.ruby,
        tags: ['ruby'],
        become: yes,

        # rvm1_install_flags: '--auto-dotfiles',     # Remove --user-install from defaults
        # rvm1_install_path: /usr/local/rvm,         # Set to system location
        rvm1_install_flags: '--auto-dotfiles --user-install',
        rvm1_install_path: '/home/{{ deploy_user }}/.rvm',
        rvm1_rubies: ['ruby-3.0.0'],
        # rvm1_user: "{{ deploy_user }}",
        rvm1_user: "{{ root_user }}",                          # Need root account to access system location
        rvm1_rvm_version: 'stable',
      }
    - {
        role: fix_rvm_access,
        tags: ['ruby', 'rvm_access'],
        become: yes
      }

roles/fix_rvm_access/tasks/main.yml:

---
- name: Change dir access from root to app user
  shell: chown -R app /home/{{ deploy_user }}/.rvm
  become: true

- name: "Create ruby-3.0.0@{{ rvm_gemset_name }} gemset"
  shell: /home/{{ deploy_user }}/.rvm/bin/rvm ruby-3.0.0 do /home/{{ deploy_user }}/.rvm/bin/rvm gemset create {{ rvm_gemset_name }}

@pkuczynski
Copy link
Member

@sfgeorge @thbar should we do anything about it, or shall we just close it with this workaround documented here?

@thbar
Copy link
Contributor

thbar commented Mar 27, 2022

@pkuczynski given that 3.0.0 lacks security fixes provided in later 3.0.x, I would probably close, unless the same issue also exists with 3.0.3 (https://www.ruby-lang.org/en/downloads/releases/).

@pkuczynski
Copy link
Member

@suryart we will close for now, but let us know if the issue still exists and we will re-open...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants