2

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:       ""
Evan
  • 1,737
  • 1
  • 19
  • 32
  • I have no such problem. What's the output of `rvm info` after reboot? – Sergio Tulentsev Dec 29 '11 at 16:00
  • I added the results on `rvm info` to the answer above - I'm at a pretty basic level with RVM in general, so I'm not sure if there are problems there or not – Evan Dec 29 '11 at 16:08

1 Answers1

10

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
Sergio Tulentsev
  • 226,338
  • 43
  • 373
  • 367
  • Good stuff, thanks! Only difference is I removed the `--create` so the statement look as so: `rvm use --default 1.9.2@rails3.1` - Appreciate the guidance – Evan Dec 29 '11 at 16:18
  • Yeah, if it already existed, no need to run with `--create`. Glad I helped :-) – Sergio Tulentsev Dec 29 '11 at 16:20
  • No that's not the solution. I have a default Ruby set, and still I have the same problem, i.e. after reboot, the default gemset is not set anymore. – mxk Jun 08 '12 at 09:30
  • @Matthias: what is set instead? Is RVM loading properly? – Sergio Tulentsev Jun 08 '12 at 10:34
  • @Sergio: sorry, forgot to come back about this: I was doing `$rvm gemset use ... --default` instead of `rvm use ...`. It does work. – mxk Jun 08 '12 at 15:33