15

To open this project (revel) I need to be using ruby-2.1.2. I have both ruby-2.1.0 and ruby-2.1.2 installed, but I think the 2.1.2 version is corrupt for some reason and I can't seem to use it.

|~/desktop/ix/projects/revel> rvm use 2.1.2
Using /Users/lianoosh/.rvm/gems/ruby-2.1.2
<internal:gem_prelude>:1:in `require': cannot load such file -- rubygems.rb (LoadError)
    from <internal:gem_prelude>:1:in `<compiled>'

|~/desktop/ix/projects/revel> gem list
<internal:gem_prelude>:1:in `require': cannot load such file -- rubygems.rb (LoadError)
    from <internal:gem_prelude>:1:in `<compiled>'

|~/desktop/ix/projects/revel> gem update --system 
<internal:gem_prelude>:1:in `require': cannot load such file -- rubygems.rb (LoadError)
    from <internal:gem_prelude>:1:in `<compiled>'

When I tried to uninstall to reinstall I get:

|~/desktop/ix/projects/revel> rvm uninstall 2.1.2
ruby-2.1.2 - #removing rubies/ruby-2.1.2............................................................................................................................|
Error running '__rvm_rm_rf /Users/lianoosh/.rvm/rubies/ruby-2.1.2',
showing last 15 lines of /Users/lianoosh/.rvm/log/1408110977_ruby-2.1.2/remove.rubies.log
rm: /Users/lianoosh/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/tzinfo-1.2.1/test/zoneinfo: Permission denied
rm: /Users/lianoosh/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/tzinfo-1.2.1/test: Permission denied
rm: /Users/lianoosh/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/tzinfo-1.2.1/tzinfo.gemspec: Permission denied
rm: /Users/lianoosh/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/tzinfo-1.2.1: Directory not empty
rm: /Users/lianoosh/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems: Directory not empty
rm: /Users/lianoosh/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0: Directory not empty
rm: /Users/lianoosh/.rvm/rubies/ruby-2.1.2/lib/ruby/gems: Directory not empty
rm: /Users/lianoosh/.rvm/rubies/ruby-2.1.2/lib/ruby: Directory not empty
rm: /Users/lianoosh/.rvm/rubies/ruby-2.1.2/lib: Directory not empty
rm: /Users/lianoosh/.rvm/rubies/ruby-2.1.2: Directory not empty
++ typeset ret=1
++ rvm_debug '__rvm_rm_rf error removing target dir '\''/Users/lianoosh/.rvm/rubies/ruby-2.1.2'\''.'
++ ((  0  ))
++ return 0
++ return 1

Then:

|~/desktop/ix/projects/revel> rvm list

rvm rubies

   ruby-2.1.0 [ x86_64 ]
=* ruby-2.1.2 [ missing bin/ruby ]

# => - current
# =* - current && default
#  * - default

So when I try to reinstall I get:

Already installed ruby-2.1.2.
To reinstall use:

    rvm reinstall ruby-2.1.2

And when I do that I get a bunch of permission denied messages and directory not empty and go right back to where I started. Also:

Empty path passed to certificates update, functions stack: requirements_osx_update_openssl_cert_run rvm_requiremnts_fail_or_run_action __rvm_osx_ssl_certs_ensure_for_ruby __rvm_osx_ssl_certs_ensure_for_ruby_except_jruby external_import_setup external_import main

Please help!

Liana Kadisha
  • 153
  • 1
  • 1
  • 4
  • 1
    Not a direct answer, but I've found managing versions with [`rbenv`](https://github.com/sstephenson/rbenv) to be much easier then `rvm`. – Matt Aug 15 '14 at 14:49

3 Answers3

12

Try this:

rvm fix-permissions

rvm reinstall 2.1.2
Amr Arafat
  • 469
  • 3
  • 8
4

Even I faced this issue today but installing Ruby again does not seem right to me as everything was working well for me since yesterday

As per the error I just updated RubyGem and that worked well for me.

gem install rubygems-update

update_rubygems
shinesecret
  • 1,402
  • 12
  • 16
0

Issues with broken rubies, in case of RVM can be solved in a very simple yet untidy method - rvm re-install
You need to remove RVM, along with all the rubies.
Please refer to this article

Community
  • 1
  • 1
zhirzh
  • 3,273
  • 3
  • 25
  • 30