Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I keep my rvm gemset while using tmux?

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.

like image 895
Dty Avatar asked Apr 30 '11 01:04

Dty


2 Answers

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
like image 137
Kris Avatar answered Nov 12 '22 02:11

Kris


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

like image 24
Dty Avatar answered Nov 12 '22 03:11

Dty