在Rails中使用Linux时,我似乎从来没有遇到过这个问题,但是每次重新启动我的机器时都会更改为OSX,RVM会丢失它的gemsets列表,但它们实际上并没有消失.
例如,我已经制作了几个宝石,我重启了我的电脑.@H_403_3@
我运行以下命令:@H_403_3@
$rvm gemset list gemsets for system (found in /Users/evan/.rvm/gems/system) *
当我运行rails s来启动我的服务器时,这当然会造成严重破坏.@H_403_3@
我设法恢复宝石的唯一方法是创建一个虚拟宝石集:@H_403_3@
$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
这显示了我创建(和需要)的所有gemsets.此时我将gemset更改回我想要的:@H_403_3@
$rvm gemset use rails3.1 Using /Users/evan/.rvm/gems/ruby-1.9.2-p290 with gemset rails3.1
此时我回到了需要进行功能开发的地方,直到下次重启.@H_403_3@
我相信我在RVM网站上正确地遵循了指示,而我的.bash_profile看起来是这样的:@H_403_3@
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
我的问题是:@H_403_3@
如何配置RVM以“记住”我创建的gemset而不创建/删除虚拟的gemset?@H_403_3@
$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: ""