Trying to get a gem working so, following a SO suggestion, I deleted older versions of ruby I had as follows:
$ which -a ruby
/Users/snowcrash/.rvm/rubies/ruby-1.9.2-p318/bin/ruby
/Users/snowcrash/.rvm/bin/ruby
$ rm /Users/snowcrash/.rvm/bin/ruby
However, a couple of hours later I tried which -a ruby
again and this file had returned:
/Users/snowcrash/.rvm/bin/ruby
Any suggestions how that happened?
Running Mac OS X 10.8.2.
I think you only deleted either a stub or a symbolic link. It would likely be pointing to the other ruby installed above, in the longer path.
I think your RVM installation is confused because you tried to delete Ruby in an unsupported way.
RVM manages your Rubies for you and it's pretty understandable that doing things outside of RVM to the Rubies inside it, will really mess it up. In other words, don't color outside the lines.
As is, I'd blow away ~/.rvm
using rm -rf ~/.rvm
and reinstall RVM and let it reinstall the Rubies you want, then leave the internals alone until you really understand how RVM works and manages the installations.
And, when you follow suggestions to delete all versions of something using a simple command like which ruby
, be very skeptical. There is a lot more to a Ruby installation than just the interpreter. Also, some systems, like Mac OS, install Ruby for their own use, and deleting the Apple-installed system version can break apps. Reinstalling those versions is a real pain, so tip-toe carefully when removing files belonging to a language unless you really know what you're doing.