rvm / rvm1-ansible

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

Getting 'src file does not exist' for testrb for Symlink ruby binaries task #157

Closed geerlingguy closed 7 years ago

geerlingguy commented 7 years ago

It was running fine inside Travis CI for the past few weeks, but suddenly today my builds are failing on this task:

TASK [rvm_io.ruby : Symlink ruby related binaries on the system path] **********
changed: [127.0.0.1] => (item=erb)
changed: [127.0.0.1] => (item=executable-hooks-uninstaller)
changed: [127.0.0.1] => (item=gem)
changed: [127.0.0.1] => (item=irb)
changed: [127.0.0.1] => (item=rake)
changed: [127.0.0.1] => (item=rdoc)
changed: [127.0.0.1] => (item=ri)
changed: [127.0.0.1] => (item=ruby)
failed: [127.0.0.1] (item=testrb) => {"failed": true, "item": "testrb", "msg": "src file does not exist, use \"force=yes\" if you really want to create the link: /usr/local/rvm/wrappers/default/testrb", "path": "/usr/local/bin/testrb", "src": "/usr/local/rvm/wrappers/default/testrb", "state": "absent"}

I'm going to try to see if there were any changes that could've affected rvm_io.ruby installation on my end, but I can't recall anything, so posting this issue in case other people are running into the same issue.

geerlingguy commented 7 years ago

Confirmed with a fresh local build too—I have in my playbook configuration:

rvm1_rubies: ['ruby-2.3.4']
rvm1_install_path: /usr/local/rvm
rvm1_user: root

And the role is run with become: yes.

geerlingguy commented 7 years ago

My last successful build was using the same ruby version, 5 days ago, and in the logs it seems that testrb did exist then:

TASK [rvm_io.ruby : Symlink ruby related binaries on the system path] **********
changed: [127.0.0.1] => (item=erb)
changed: [127.0.0.1] => (item=executable-hooks-uninstaller)
changed: [127.0.0.1] => (item=gem)
changed: [127.0.0.1] => (item=irb)
changed: [127.0.0.1] => (item=rake)
changed: [127.0.0.1] => (item=rdoc)
changed: [127.0.0.1] => (item=ri)
changed: [127.0.0.1] => (item=ruby)
changed: [127.0.0.1] => (item=testrb)

So maybe the rvm.io package itself got messed up at some point?

geerlingguy commented 7 years ago

As a workaround, I was going to use:

rvm1_symlink_binaries:
  - 'erb'
  - 'executable-hooks-uninstaller'
  - 'gem'
  - 'irb'
  - 'rake'
  - 'rdoc'
  - 'ri'
  - 'ruby'
  # - 'testrb'

...but since that variable is defined in vars/main.yml it's not easily overridden (unless you try passing in the entire array via --extra-vars on the command line, which is really messy :/

geerlingguy commented 7 years ago

Checking:

... none of these had testrb in their bin directories :(

geerlingguy commented 7 years ago

So, it looks like upstream, the testrb file is not built/included anymore after this commit https://github.com/rvm/gem-wrappers/commit/8a355fd0925d34f7e1b7cd9b299eaf07d62bd92a — see also https://github.com/rvm/rvm/issues/4104

geerlingguy commented 7 years ago

PR at least fixes the problem. It might also be nice to have the variable itself moved into defaults/main.yml so it can be overridden in the future.

lpaulmp commented 7 years ago

@geerlingguy thanks for your contribution, this sounds reasonable - allow overwrite rvm1_symlink_binaries. I'm improving a bit the test for different distros since are reported bugs which the current tests aren't able catch.