Pregunta

I had to reinstall RVM this afternoon and am still struggling with the following problem - when I load a new terminal window (iTerm2 Build 1.0.0.20130624 with zsh 4.3.9 (i386-apple-darwin10.0)), rvm 'forgets' my gemset data.

This is a fairly common issue, but everything I've tried hasn't worked. I've done this (omitting the create as the gemset was already made):

rvm use --default 2.0.0@<gemset_name>

and this obviously doesn't work since I'm using ZSH:

Command: /bin/bash --login

so then i tried this, specifically for ZSH, but that didn't work either - upon opening iTerm I got the following error:

## exec failed ##
argpath=/usr/local/bin/zsh error=No such file or directory

I changed the command in iTerm preferences to

~/.zlogin -l

since I had added this to .zlogin

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

that also didn't work, throwing this error:

## exec failed ##
argpath=/Users/<username>/.zlogin error=Permission denied

So I switched the 'Login Shell' back to "" in iTerm preferences (so it would load without errors) and tried this in the command line:

$ source $HOME/.rvm/scripts/rvm

which gave me

source: no such file or directory: /Users/<username>/.rvm/scripts/rvm

so now I'm really confused. why is there no .rvm in my ~ directory?

Finally, here's the result of rvm info upon reopening iTerm:

system:

  system:
    uname:       "Darwin <users>-MacBook-Pro.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386"
    system:      "osx/10.6/i386"
    bash:        "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)"
    zsh:         "/bin/zsh => zsh 4.3.9 (i386-apple-darwin10.0)"

  rvm:
    version:      "rvm 1.21.16 () by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]"
    updated:      "3 hours 33 minutes 38 seconds ago"
    path:         "/usr/local/rvm"

  homes:
    gem:          "not set"
    ruby:         "/usr/local/rvm/rubies/ruby-2.0.0-p247"

  binaries:
    ruby:         "/usr/local/rvm/rubies/ruby-2.0.0-p247/bin/ruby"
    irb:          "/usr/local/rvm/rubies/ruby-2.0.0-p247/bin/irb"
    gem:          "/usr/local/rvm/rubies/ruby-2.0.0-p247/bin/gem"
    rake:         "/usr/local/rvm/gems/ruby-2.0.0-p247@global/bin/rake"

  environment:
    PATH:         "/usr/local/rvm/gems/ruby-2.0.0-p247@<gemset>/bin:/usr/local/rvm/gems/ruby-2.0.0-p247@global/bin:/usr/local/rvm/rubies/ruby-2.0.0-p247/bin:/usr/local/rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin:/Users/<username>/.rvm/bin"
    GEM_HOME:     ""
    GEM_PATH:     ""
    MY_RUBY_HOME: "/usr/local/rvm/rubies/ruby-2.0.0-p247"
    IRBRC:        "/usr/local/rvm/rubies/ruby-2.0.0-p247/.irbrc"
    RUBYOPT:      ""
    gemset:       ""
¿Fue útil?

Solución

You have a system installation of rvm - /usr/local/rvm, it is not recommended for basic use (mainly because of the problems you have and many others).

Start with cleaning ~/.zshrc from forced PATH= as it is described in this pull request https://github.com/robbyrussell/oh-my-zsh/pull/1359

Then update RVM:

rvmsudo /usr/local/rvm/bin/rvm get head --auto-dotfiles

and restart computer.

There is problem with system installation that it is loading early and the default ruby is loaded when computer is started, you need to restart computer for the new default to be effective. This problem does not happen when you use user installation of rvm.

optionally

Remove system installation and install rvm for user:

  1. Remove system rvm:

    rm -rf /etc/rvmrc /etc/profile.d/rvm.sh /usr/local/rvm
    
  2. Restart computer to get rid of environment variables (yes this is required).

  3. Confirm that environment is clear from rvm (should be empty output):

    env | grep rvm
    
  4. Install user rvm:

    \curl -L https://get.rvm.io | bash
    
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top