8

I have a .rvmrc file in my project directory (let's call it /GameScores). It will load a gemset named GameScores when I move into that directory. This part works fine.

But while in /GameScores, as soon as I go into tmux my terminal is no longer using the GameScores gemset. If I do rvm gemset name I get a blank

Any idea how to fix this? I want to be able to keep using my gemset when I use tmux. My current workaround is to simply run rvm gemset use GameScores when I go into tmux but I don't want to do that every time.

4
  • I can't reproduce this problem. If I cd into a directory with a .rvmrc, the gemset switch happens, but if I then enter a tmux session, the gemset is still chosen. What version of rvm are you using? (rvm 1.6.4 here; tmux 1.4)
    – Telemachus
    Apr 30, 2011 at 1:50
  • rvm 1.2.4. Let me go update :) Ok, I'm on 1.6.4 and tmux 1.4 and the same thing happens. No gemset changes, still empty. (I restarted my terminal to make sure to use 1.6.4 after installing). I'm also using zsh on mac osx.
    – Dty
    Apr 30, 2011 at 1:59
  • Maybe it's a zsh interaction? I'm using Bash, and that seems to be the only difference between us. If nobody here can answer, try #rvm on irc.freenode.net.
    – Telemachus
    Apr 30, 2011 at 2:10
  • Tried with bash and still have the same issue. Yep, time to hit up #rvm
    – Dty
    Apr 30, 2011 at 2:34

2 Answers 2

3

cd . does not work for me, but this will work in zsh and bash:

cd ..;cd -

Just put it at the bottom of .zshrc / .bashrc etc.

  • rvm 1.22.3
  • tmux 1.8
  • zsh 5.0.2
1
  • In case anyone else finds this - now that rvm sources itself from .zlogin, I had to put this in my .zlogin file rather than .zshrc. Nov 30, 2015 at 8:32
2

The easiest fix for this is to cd . after starting tmux. This is the answer provided by Wayne, the author of rvm.

Edit 1: If the above does not work you can do:

cd ..;cd -

This is essentially the same as cd .

cd .. takes you up one dir

cd - takes you back

4
  • 8
    this actually doesn't work for me anymore. so i am doing cd ..;1 now in zsh
    – Dty
    Oct 27, 2012 at 1:58
  • 2
    cd ..;1 at the bottom of my .zshrc was spot on. Works well. Feb 3, 2013 at 12:14
  • I'm curious what that "1" is supposed to do. It gives me "zsh: command not found: 1" Nov 30, 2015 at 8:31
  • @JonathandelStrother 1 goes back to the previous dir. 2 goes back to the one before that, etc. I'm using oh-my-zsh and maybe it's provided by that and not zsh itself?
    – Dty
    Dec 1, 2015 at 0:55

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.