geerlingguy/ansible-role-ruby

Failed to create symlink /usr/local/bin/ruby_version

cdata opened this issue · 8 comments

When running this role, it fails to create this symlink because the file does not exist. Is there actually supposed to be a ruby_version binary on the system somewhere? Or is this a typo?

What OS and version are you using? I was testing in CentOS 6.5 and it seemed to work fine there.

I have encountered this error while attempting to provision on Ubuntu Server 12.04 / 64. The failing step reads like this:

TASK: [geerlingguy.ruby | Add ruby symlinks.] *********************************
changed: [default] => (item=erb)
changed: [default] => (item=gem)
changed: [default] => (item=irb)
changed: [default] => (item=rake)
changed: [default] => (item=rdoc)
failed: [default] => (item=ruby_version) => {"failed": true, "item": "ruby_version", "path": "/usr/bin/ruby_version", "src": "/usr/local/bin/ruby_version", "state": "absent"}
msg: src file does not exist, use "force=yes" if you really want to create the link: /usr/bin/ruby_version
changed: [default] => (item=ruby)
changed: [default] => (item=testrb)

As I mentioned already, an inspection of /usr/local/bin reveals that there is no binary called ruby_version present.

Okay, thanks! I will look into this further and also make sure this role is tested via Travis CI, so hopefully problems like this don't crop up again :)

Had the same issue while provisioning a Ubuntu precise 64 box from http://www.vagrantbox.es/.

Following is my error output:


TASK: [geerlingguy.ruby | Add ruby symlinks.] *********************************
failed: [default] => (item=erb) => {"failed": true, "item": "erb", "path": "/usr/bin/erb", "state": "absent"}
msg: Error while linking: [Errno 13] Permission denied
failed: [default] => (item=gem) => {"failed": true, "item": "gem", "path": "/usr/bin/gem", "state": "absent"}
msg: Error while linking: [Errno 13] Permission denied
failed: [default] => (item=irb) => {"failed": true, "item": "irb", "path": "/usr/bin/irb", "state": "absent"}
msg: Error while linking: [Errno 13] Permission denied
failed: [default] => (item=rake) => {"failed": true, "item": "rake", "path": "/usr/bin/rake", "state": "absent"}
msg: Error while linking: [Errno 13] Permission denied
failed: [default] => (item=rdoc) => {"failed": true, "item": "rdoc", "path": "/usr/bin/rdoc", "state": "absent"}
msg: Error while linking: [Errno 13] Permission denied
failed: [default] => (item=ruby_version) => {"failed": true, "item": "ruby_version", "path": "/usr/bin/ruby_version", "src": "/usr/local/bin/ruby_version", "state": "absent"}
msg: src file does not exist, use "force=yes" if you really want to create the link: /usr/bin/ruby_version
failed: [default] => (item=ruby) => {"failed": true, "item": "ruby", "path": "/usr/bin/ruby", "state": "absent"}
msg: Error while linking: [Errno 13] Permission denied
failed: [default] => (item=testrb) => {"failed": true, "item": "testrb", "path": "/usr/bin/testrb", "state": "absent"}
msg: Error while linking: [Errno 13] Permission denied

@vasanthela - it looks like the issue you're having is related to not having the proper privileges when running the role. Try running the role with sudo, like so (when including in your main playbook):

  - { role: geerlingguy.ruby, sudo: yes }

@cdata - I'm working on this now. Just committed Travis test integration so I can test some fixes to see if everything works as it should.

Woot 🍻

On Thu, Jun 19, 2014 at 7:44 AM, Jeff Geerling notifications@github.com
wrote:

@vasanthela https://github.com/vasanthela - it looks like the issue
you're having is related to not having the proper privileges when running
the role. Try running the role with sudo, like so (when including in your
main playbook):

  • { role: geerlingguy.ruby, sudo: yes }

@cdata https://github.com/cdata - I'm working on this now. Just
committed Travis test integration so I can test some fixes to see if
everything works as it should.


Reply to this email directly or view it on GitHub
#1 (comment)
.

Looks like it's finally working. I'm tagging a new release and will get it on Galaxy now.

Thanks for the info. The fix works.