RVM and OSX Lion - RVM 'forgets' gemsets o

2019-01-27 00:02发布

问题:

I never seemed to have this problem while doing Rails work in Linux, but since changing to OSX everytime I reboot my machine, RVM loses its list of gemsets, but they aren't actually gone.

For example, I have several gemsets already made, and I restart my computer.

I run the following command:

$ rvm gemset list

gemsets for system (found in /Users/evan/.rvm/gems/system)
*

This of course causes havoc when I run rails s to start up my server.

The only way I've managed to get the gemsets back is to create a dummy gemset:

$ rvm --create 1.9.2@blahblah
$ rvm gemset list

gemsets for ruby-1.9.2-p290 (found in /Users/evan/.rvm/gems/ruby-1.9.2-p290)
asdasdads
=> blahblah
global
rails3.1
rails31
test
test3
test6
whymvc

This shows all of the gemsets I have created (and need). At this point I change the gemset back to the one I want:

$ rvm gemset use rails3.1
Using /Users/evan/.rvm/gems/ruby-1.9.2-p290 with gemset rails3.1

At this point I'm back where I need to be to develop functionally until the next reboot.

I believe I followed the directions correctly at the RVM site, and my .bash_profile looks like so:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function

My question is this:

How can I configure RVM to 'remember' the gemsets I have created without creating/deleting dummy ones?

Edit #1 - rvm info output

Running rvm info produces the following output:

$ rvm info

system:

   system:
   uname:       "Darwin emcummings-pc 11.2.0 Darwin Kernel Version 11.2.0: Tue Aug  9 20:54:00 PDT 2011; root:xnu-1699.24.8~1/RELEASE_X86_64 x86_64"
   bash:        "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin11)"
   zsh:         "/bin/zsh => zsh 4.3.11 (i386-apple-darwin11.0)"

rvm:
   version:      "rvm 1.10.0-pre by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/]"

homes:
   gem:          "not set"
   ruby:         "not set"

binaries:
   ruby:         "/usr/bin/ruby"
   irb:          "/usr/bin/irb"
   gem:          "/usr/bin/gem"
   rake:         "/usr/bin/rake"

environment:
  PATH:         "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/evan/.rvm/bin"
  GEM_HOME:     ""
  GEM_PATH:     ""
  MY_RUBY_HOME: ""
  IRBRC:        ""
  RUBYOPT:      ""
  gemset:       ""

回答1:

It appears that your default RVM ruby is not set.

Try running this:

rvm use --default --create 1.9.2@rails3.1

and then rebooting.

If your gemset already exists, you can omit the --create.

rvm use --default 1.9.2@rails3.1