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

Error while evaluating conditional (rvm1_delete_ruby): 'ruby' is undefined #156

Closed
geerlingguy opened this issue Aug 30, 2017 · 4 comments
Closed
Labels

Comments

@geerlingguy
Copy link
Contributor

When I try to delete an older version of ruby using rvm1_delete_ruby, I get the following error:

TASK [rvm_io.ruby : Detect if ruby version can be deleted] *************************************************************
fatal: [hostname]: FAILED! => {"failed": true, "msg": "The conditional check 'rvm1_delete_ruby' failed. The error was: error while evaluating conditional (rvm1_delete_ruby): 'ruby' is undefined\n\nThe error appears to have been in '/Users/jeff.geerling/playbook/roles/rvm_io.ruby/tasks/rubies.yml': line 65, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Detect if ruby version can be deleted\n  ^ here\n"}

Tried this on two servers where I had rvm1_rubies: ['ruby-2.3.3'] originally, then set rvm1_rubies: ['ruby-2.3.4'], and added the variable rvm1_delete_ruby: ruby-2.3.1 and ran the playbook again.

@geerlingguy
Copy link
Contributor Author

For now, on the servers where this was happening, I manually ran sudo /usr/local/rvm/bin/rvm remove ruby-2.3.1 to get the old version removed. Couldn't figure out why the error was happening though :-/

@Scaramush
Copy link

I was able to fix it by changing when statement in "Detect if ruby version can be deleted" and "Delete ruby version" from when: rvm1_delete_ruby to when: rvm1_delete_ruby is defined in "Detect if ruby version can be deleted"
and from when: rvm1_delete_ruby and detect_delete_ruby.rc == 0 to when: (rvm1_delete_ruby is defined) and (detect_delete_ruby.rc == 0) in "Delete ruby version"

@thbar
Copy link
Contributor

thbar commented Jul 27, 2020

This is being addressed in #212 (wip).

@pkuczynski pkuczynski added the bug label Jul 28, 2020
@thbar
Copy link
Contributor

thbar commented Jul 30, 2020

#212 has been merged in master and seems to work well (except a bug on "check" mode #218). I believe we can close for now!

@thbar thbar closed this as completed Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants