rvm / rvm1-ansible

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

errors in rubies task #78

Closed alettieri closed 8 years ago

alettieri commented 8 years ago

I'm receiving the following error during the Install rubies task:

error while evaluating conditional: rvm1_rubies and item.rc != 0

When looking at the tasks/rubies.yml file:

In task Install rubies:

 when: rvm1_rubies and item.rc != 0

It seems that the dict attribute rc may be missing at times.

It works fine when there's a fallback value.

 when: rvm1_rubies and item.rc|default(0) != 0

In task Select default ruby:

The stdout may need a default fallback as well. It threw errors as well.

when: detect_default_ruby_version.stdout == '' or
        rvm1_default_ruby_version not in detect_default_ruby_version.stdout

works fine when changed to:

when: detect_default_ruby_version.stdout|default() == '' or
        rvm1_default_ruby_version not in detect_default_ruby_version.stdout

Fixing these two lines solved my problem.

Here are some rvm1 variables I'm using in case it helps:

rvm1_rubies:
  - 'ruby-2.2.0'
rvm1_install_flags: '--auto-dotfiles --user-install'
rvm1_rvm_version: 'stable'
rvm1_rvm_check_for_updates: True
nickjj commented 8 years ago

Hi, thanks a lot for the bug report. It would be awesome if you could create a PR out of this. I'll merge it into the next release.

alettieri commented 8 years ago

Cool. will do.

alettieri commented 8 years ago

Another note. I should have mentioned that this happens when I set the --check flag.