如何在使用tmux时保留我的rvm gemset?

时间:2021-12-08 07:23:48

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.

我的项目目录中有一个.rvmrc文件(让我们称之为/ GameScores)。当我进入该目录时,它将加载一个名为GameScores的宝石集。这部分工作正常。

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

但是在/ GameScores中,只要我进入tmux,我的终端就不再使用GameScores gemset了。如果我做rvm gemset名称我得到一个空白

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.

知道如何解决这个问题吗?我希望能够在使用tmux时继续使用我的gemset。我目前的解决方法是在进入tmux时简单地运行rvm gemset使用GameScores,但我不想每次都这样做。

2 个解决方案

#1


3  

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

cd。对我不起作用,但这将在zsh和bash中起作用:

cd ..;cd -

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

只需将它放在.zshrc / .bashrc等的底部。

  • rvm 1.22.3
  • tmux 1.8
  • zsh 5.0.2

#2


2  

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

对此最简单的解决方法是cd。在启动tmux之后。这是rvm的作者Wayne提供的答案。

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

编辑1:如果以上操作不起作用,您可以执行以下操作:

cd ..;cd -

This is essentially the same as cd .

这与cd基本相同。

cd .. takes you up one dir

cd ..带你一个目录

cd - takes you back

cd - 带你回去

#1


3  

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

cd。对我不起作用,但这将在zsh和bash中起作用:

cd ..;cd -

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

只需将它放在.zshrc / .bashrc等的底部。

  • rvm 1.22.3
  • tmux 1.8
  • zsh 5.0.2

#2


2  

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

对此最简单的解决方法是cd。在启动tmux之后。这是rvm的作者Wayne提供的答案。

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

编辑1:如果以上操作不起作用,您可以执行以下操作:

cd ..;cd -

This is essentially the same as cd .

这与cd基本相同。

cd .. takes you up one dir

cd ..带你一个目录

cd - takes you back

cd - 带你回去