03 Apr 2012, 20:34
Billgathen_pragsmall

Bill Gathen (28 posts)

Whenever I ran @rails server@ from within a tmux shell window, I’d get rubygem dependency errors from bundler, but the ZSH prompt and command-completion were working, so I knew the right shell was getting loaded.

The last line of my user-level @.zshrc@ file is @rvm use default@ (currently ruby 1.9.2), and tmux was using 1.9.2, so that was fine as well.

However, RVM apparently ignored my local .rvmrc file, which uses a local gemset, so none of my gems were found.

@source .rvmrc@ in the shell window allowed me to run @rails server@ with no problem, but that’s a hassle to do every time.

Appending @source .rvmrc@ to the end of my @.zshrc@ file explicitly causes the local gemset to be loaded if the file exists, and is a no-op if not. My terminal windows act the same as always, but now every tmux window/pane acts just like it does from the command-line.

21 Apr 2012, 22:50
20120318-img_26712_pragsmall

Richard Hart (1 post)

Brilliant, just what I needed! Was trying to follow other people’s suggestion of adding “cd .”, but wasn’t working for me.

07 Feb 2013, 13:46
Generic-user-small

James Mac William (1 post)

adding

/bin/bash –login

to your .zshrc file should do it

  You must be logged in to comment