简体   繁体   English

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

[英]How do I keep my rvm gemset while using tmux?

I have a.rvmrc file in my project directory (let's call it /GameScores ).我的项目目录中有一个 .rvmrc 文件(我们称之为/GameScores )。 It will load a gemset named GameScores when I move into that directory.当我进入该目录时,它将加载一个名为GameScores的 gemset。 This part works fine.这部分工作正常。

But while in /GameScores , as soon as I go into tmux my terminal is no longer using the GameScores gemset.但是在/GameScores中,只要我 go 进入 tmux,我的终端就不再使用GameScores gemset。 If I do rvm gemset name I get a blank如果我做rvm gemset name我得到一个空白

Any idea how to fix this?知道如何解决这个问题吗? I want to be able to keep using my gemset when I use tmux.当我使用 tmux 时,我希望能够继续使用我的 gemset。 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.我目前的解决方法是在我 go 进入 tmux 时简单地运行rvm gemset use GameScores但我不想每次都这样做。

cd. does not work for me, but this will work in zsh and bash:对我不起作用,但这适用于 zsh 和 bash:

cd ..;cd -

Just put it at the bottom of .zshrc / .bashrc etc.只需将其放在.zshrc / .bashrc等的底部即可。

  • rvm 1.22.3转速 1.22.3
  • tmux 1.8多路复用器 1.8
  • zsh 5.0.2 zsh 5.0.2

The easiest fix for this is to cd.最简单的解决方法是cd. after starting tmux.启动 tmux 后。 This is the answer provided by Wayne, the author of rvm.这是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 -带你回去

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM