I can't remove ruby, reinstall ruby, start or test specific rails project using ruby 2.1.0.
How to remove & install new ruby?
Error's Examples:
1.
$ rails s
/Users/user/.rvm/gems/ruby-2.1.0/bin/rails:23:in `load': cannot load such file -- /Users/user/.rvm/gems/ruby-2.1.0/gems/railties-4.1.1/bin/rails (LoadError)
from /Users/user/.rvm/gems/ruby-2.1.0/bin/rails:23:in `<main>'
from /Users/user/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `eval'
from /Users/user/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `<main>'
2.
$ rvm remove ruby-2.1.0
ruby-2.1.0 - #removing src/ruby-2.1.0..
ruby-2.1.0 - #removing rubies/ruby-2.1.0......................................
Error running '__rvm_rm_rf /Users/user/.rvm/rubies/ruby-2.1.0',
showing last 15 lines of /Users/user/.rvm/log/1405545940_ruby-2.1.0/remove.rubies.log
rm: /Users/user/.rvm/rubies/ruby-2.1.0/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.2.1/test: Permission denied
rm: /Users/user/.rvm/rubies/ruby-2.1.0/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.2.1/test_all: Permission denied
rm: /Users/user/.rvm/rubies/ruby-2.1.0/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.2.1/Y_U_NO_GEMSPEC.md: Permission denied
rm: /Users/user/.rvm/rubies/ruby-2.1.0/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.2.1: Directory not empty
rm: /Users/user/.rvm/rubies/ruby-2.1.0/lib/ruby/gems/2.1.0/gems: Directory not empty
rm: /Users/user/.rvm/rubies/ruby-2.1.0/lib/ruby/gems/2.1.0: Directory not empty
rm: /Users/user/.rvm/rubies/ruby-2.1.0/lib/ruby/gems: Directory not empty
rm: /Users/user/.rvm/rubies/ruby-2.1.0/lib/ruby: Directory not empty
rm: /Users/user/.rvm/rubies/ruby-2.1.0/lib: Directory not empty
rm: /Users/user/.rvm/rubies/ruby-2.1.0: Directory not empty
++ typeset ret=1
++ rvm_debug '__rvm_rm_rf error removing target dir '\''/Users/user/.rvm/rubies/ruby-2.1.0'\''.'
++ (( 0 ))
++ return 0
++ return 1
Other attempts to fix:
Unknown ruby string (do not know how to handle): ruby-2.1.0.
Fixed: I completely clean out all traces of RVM from my system (https://rvm.io/support/troubleshooting), rebuilt environment for each project.
Works!
the 1st error can be caused by installation of gems broken in half,
the 2nd error is caused by using sudo/rvmsudo/root with gems, use rvm fix-permissions to fix it
as for the last error Unknown ruby string (do not know how to handle): ruby-2.1.0. - this could be possibly fixed, but without seeing what caused it I can not be sure.
:+1: Thanks @mpapis
Most helpful comment
the 1st error can be caused by installation of gems broken in half,
the 2nd error is caused by using
sudo/rvmsudo/rootwith gems, uservm fix-permissionsto fix itas for the last error
Unknown ruby string (do not know how to handle): ruby-2.1.0.- this could be possibly fixed, but without seeing what caused it I can not be sure.