.rvmrc and mac osx lion "restore" issue Just switched to lion a couple of days back, and juts noticed that when you quit Terminal while in a folder, when you open it, it should be back in that folder(along with your other tabs).

This is a good feature indeed, but the problem is, it doesn't "refresh" your paths. meaning even if you had a .rvmrc file in your app folder, it won't set the ruby and gemset again. you'll have to actually cd out and get back in again, which defeats the purpose of having an rvmrc.

Is this a known bug and are there an fixes/patches for it already?

EDIT
Following Chris Page's advice, I added cd "$PWD" in the last line of my .bashrc (which is loaded by my .bash_profile)

This in turn "loads" the rvmrc as expected :

Last login: Tue Aug  9 11:29:09 on ttys003
Using /Users/eumir/.rvm/gems/ruby-1.9.2-p180 with gemset mygemset

eumir$ gem list
/Users/eumir/.rvm/rubies/ruby-1.9.2-p180/bin/gem:12:in `require': no such file to load -- rubygems (LoadError)
from /Users/eumir/.rvm/rubies/ruby-1.9.2-p180/bin/gem:12

eumir$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.2.0]


As you can see, it did load the gemset(printed out by "Using /Users...") but trying to do gem list and showing the ruby version says that it still didn't load it. (the ruby version should be 1.9.2)

EDIT 2 

I updated my rvm and now any of the fixes aren't working!

It prints out that it IS using the gemset in my rvm but when I do a gem env, i get this:

eumir$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.6
  - RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]
  - INSTALLATION DIRECTORY: /Users/eumir/.rvm/gems/ruby-1.8.7-p174@awetest
  - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/eumir/.rvm/gems/ruby-1.8.7-p174@awetest/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - universal-darwin-11
  - GEM PATHS:
     - /Users/eumir/.rvm/gems/ruby-1.8.7-p174@mygemset
     - /Users/eumir/.rvm/gems/ruby-1.8.7-p174@global
  - GEM CONFIGURATION:
     - :update_sources =&gt; true
     - :verbose =&gt; true
     - :benchmark =&gt; false
     - :backtrace =&gt; false
     - :bulk_threshold =&gt; 1000
     - :sources =&gt; ["http://rubygems.org/", "http://gemcutter.org"]
     - "gem" =&gt; "--no-ri --no-rdoc"
  - REMOTE SOURCES:
     - http://rubygems.org/
     - http://gemcutter.org


doing cd ../ and then cd myfolder and then gem env results with this:

eumir$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.7.2
  - RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.4.0]
  - INSTALLATION DIRECTORY: /Users/eumir/.rvm/gems/ruby-1.8.7-p174@awetest
  - RUBY EXECUTABLE: /Users/eumir/.rvm/rubies/ruby-1.8.7-p174/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/eumir/.rvm/gems/ruby-1.8.7-p174@awetest/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-darwin-10
  - GEM PATHS:
     - /Users/eumir/.rvm/gems/ruby-1.8.7-p174@mygemset
     - /Users/eumir/.rvm/gems/ruby-1.8.7-p174@global
  - GEM CONFIGURATION:
     - :update_sources =&gt; true
     - :verbose =&gt; true
     - :benchmark =&gt; false
     - :backtrace =&gt; false
     - :bulk_threshold =&gt; 1000
     - :sources =&gt; ["http://rubygems.org/", "http://gemcutter.org"]
     - "gem" =&gt; "--no-ri --no-rdoc"
  - REMOTE SOURCES:
     - http://rubygems.org/
     - http://gemcutter.org


which is the correct environment. As you can see, the gemset was loaded correctly(along with the gems) but it is still using the system ruby instead of the rvmrc ruby.
Lion Terminal selects/restores the working directory by setting it with chdir() before the shell starts. If you want to automatically perform some sort of additional work related to the working directory, you should customize the shell with a startup script that performs some command with $PWD.

Assuming you're using bash (the default), what you apparently would want to do is add something like this in ~/.bashrc:

cd "$PWD"


I'm not familiar with rvmc, but I assume it must use the shell startup script to customize the "cd" command, so be sure to issue this command after that. Also, if you don't already have shell startup scripts, you'll usually want to create ~/.bash_profile and have it run ~/.bashrc if it exists (look around on StackExchange or use Google to find this common idiom).