I recently decided to switch my Ansible deployment to install Ruby via rbenv rather than from apt-get via ruby1.9.1. Now I'm getting an error when trying to install the gem via Ansible.
TASK: [nginx | s3cp gem] ******************************************************
failed: [staging.myapp.com] => {"cmd": ["/usr/local/bin", "query", "-n", "^s3cp$"], "failed": true, "item": "", "rc": 13}
msg: [Errno 13] Permission denied
FATAL: all hosts have already failed -- aborting
Ansible playbook entry for this command:
- name: s3cp gem
gem: name=s3cp state=present executable=/usr/local/bin
I have sudo
set to "yes"
in a higher-level call to this playbook part. So I am not sure why it's tripping up. I also am able to login with the same user used for Ansible and navigate to that directory and also install this gem.
It was working fine when I was using apt-get to install ruby1.9.1. Any ideas?
This is deployed to an Ubuntu 13.04
server, by the way.
MORE INFORMATION:
Apparently it's not just tripping up on s3cp. I skipped that one and went on to another command to install bundler. This command also would not work (failed in the same way). I am wondering if there's a default ruby that's conflicting with the rbenv ruby (though, which ruby
when ssh'ed in is yielding the expected rbenv directory).
MORE-MORE INFO:
I tried to install ruby via rvm instead. I had the same error. :(