rvm / rvm1-ansible

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

Getting error on rvm Symlink ruby related binaries task #56

Open jbmyid opened 9 years ago

jbmyid commented 9 years ago

TASK: [rvm_io.rvm1-ruby | Symlink ruby related binaries on the system path] *\ failed: [192.168.111.101] => (item=bundle) => {"failed": true, "gid": 0, "group": "root", "item": "bundle", "mode": "0755", "owner": "root", "path": "/usr/local/bin/bundle", "size": 498, "state": "file", "uid": 0} msg: refusing to convert between file and link for /usr/local/rvm/wrappers/default/bundle failed: [192.168.111.101] => (item=bundler) => {"failed": true, "gid": 0, "group": "root", "item": "bundler", "mode": "0755", "owner": "root", "path": "/usr/local/bin/bundler", "size": 499, "state": "file", "uid": 0} msg: refusing to convert between file and link for /usr/local/rvm/wrappers/default/bundler failed: [192.168.111.101] => (item=erb) => {"failed": true, "gid": 0, "group": "root", "item": "erb", "mode": "0755", "owner": "root", "path": "/usr/local/bin/erb", "size": 4844, "state": "file", "uid": 0} msg: refusing to convert between file and link for /usr/local/rvm/wrappers/default/erb

ok: [192.168.111.101] => (item=executable-hooks-uninstaller) failed: [192.168.111.101] => (item=gem) => {"failed": true, "gid": 0, "group": "root", "item": "gem", "mode": "0755", "owner": "root", "path": "/usr/local/bin/gem", "size": 548, "state": "file", "uid": 0} msg: refusing to convert between file and link for /usr/local/rvm/wrappers/default/gem failed: [192.168.111.101] => (item=irb) => {"failed": true, "gid": 0, "group": "root", "item": "irb", "mode": "0755", "owner": "root", "path": "/usr/local/bin/irb", "size": 192, "state": "file", "uid": 0} msg: refusing to convert between file and link for /usr/local/rvm/wrappers/default/irb failed: [192.168.111.101] => (item=rake) => {"failed": true, "gid": 0, "group": "root", "item": "rake", "mode": "0755", "owner": "root", "path": "/usr/local/bin/rake", "size": 485, "state": "file", "uid": 0} msg: refusing to convert between file and link for /usr/local/rvm/wrappers/default/rake failed: [192.168.111.101] => (item=rdoc) => {"failed": true, "gid": 0, "group": "root", "item": "rdoc", "mode": "0755", "owner": "root", "path": "/usr/local/bin/rdoc", "size": 940, "state": "file", "uid": 0} msg: refusing to convert between file and link for /usr/local/rvm/wrappers/default/rdoc failed: [192.168.111.101] => (item=ri) => {"failed": true, "gid": 0, "group": "root", "item": "ri", "mode": "0755", "owner": "root", "path": "/usr/local/bin/ri", "size": 190, "state": "file", "uid": 0} msg: refusing to convert between file and link for /usr/local/rvm/wrappers/default/ri failed: [192.168.111.101] => (item=ruby) => {"failed": true, "gid": 0, "group": "root", "item": "ruby", "mode": "0755", "owner": "root", "path": "/usr/local/bin/ruby", "size": 14307944, "state": "file", "uid": 0} msg: refusing to convert between file and link for /usr/local/rvm/wrappers/default/ruby

I am trying in vertual machin with Ubuntu 14.04.3 LTS getting this error

kinopyo commented 9 years ago

I'm getting the same error, after that I ssh logged in to the server, the ruby was installed ok but not set as default

hsamadi commented 9 years ago

I'm getting the same error when I try to install ruby 2.0.0. It seems that the "Install bundler if not installed" task doesn't work correctly. So, the symlinking mechanism doesn't work as expected.

failed: [xx.xx.xx.xx] => (item=bundle) => {"failed": true, "item": "bundle", "msg": "src file does not exist, use \"force=yes\" if you really want to create the link: /usr/local/rvm/wrappers/default/bundle", "path": "/usr/local/bin/bundle", "src": "/usr/local/rvm/wrappers/default/bundle", "state": "absent"}
failed: [xx.xx.xx.xx] => (item=bundler) => {"failed": true, "item": "bundler", "msg": "src file does not exist, use \"force=yes\" if you really want to create the link: /usr/local/rvm/wrappers/default/bundler", "path": "/usr/local/bin/bundler", "src": "/usr/local/rvm/wrappers/default/bundler", "state": "absent"}
janost commented 9 years ago

I was having the same problem because the 'rvm1_default_ruby_version' variable's value was '3', therefore it tried to create a default alias for '3', and naturally it failed. I didn't have time to further investigate this, but you can work around the problem by setting 'rvm1_default_ruby_version' manually. In my case the role looks like this: - { role: rvm_io.rvm1-ruby, rvm1_rubies: '{{ ruby_version }}', rvm1_default_ruby_version: '{{ ruby_version }}', tags: ruby, sudo: True }

hsamadi commented 9 years ago

You may find this commit useful.

flynfish commented 8 years ago

@hsamadi thanks for that! You should submit a pull request :+1:

viruzzo commented 7 years ago

rvm1_rubies is a list, so you must define it as such, in your case: rvm1_rubies: [ '{{ ruby_version }}' ]

coldnebo commented 2 years ago

I'm getting something similar, but only for rake:

failed: [localhost] (item=rake) => {"ansible_loop_var": "item", "changed": false, "gid": 0, "group": "root", "item": "rake", "mode": "0755", "msg": "refusing to convert from file to symlink for /usr/local/bin/rake", "owner": "root", "path": "/usr/local/bin/rake", "size": 517, "state": "file", "uid": 0}

what does this mean? is there a workaround?