chruby-fish icon indicating copy to clipboard operation
chruby-fish copied to clipboard

Ruby is unselected when cd'ing out of a directory with a .ruby-version file

Open paddor opened this issue 2 years ago • 4 comments

With chruby version 1.0.0:

user@xxx-dev-2022 ~/d/r/other  $ chruby
   ruby-3.0.5
 * ruby-3.2.0
user@xxx-dev-2022 ~/d/r/other  $ cd test/
user@xxx-dev-2022 ~/d/r/o/test  $ chruby
   ruby-3.0.5
 * ruby-3.2.0
user@xxx-dev-2022 ~/d/r/o/test  $ cat .ruby-version
3.2.0
user@xxx-dev-2022 ~/d/r/o/test  $ cd ..
user@xxx-dev-2022 ~/d/r/other  $ chruby
   ruby-3.0.5
   ruby-3.2.0

Very confusing. Is there a way to fix this?

paddor avatar Jan 18 '23 17:01 paddor

The same applies to the environment variable $RUBYOPT. It seems to be unset as soon as I cd into a directory with a .ruby-version file. Why?

paddor avatar Feb 07 '23 13:02 paddor

@JeanMertz Any updates on this?

paddor avatar Apr 27 '23 13:04 paddor

This might help to set global ruby version

echo "source "(brew --prefix)"/Cellar/chruby-fish/1.0.0/share/fish/vendor_conf.d/chruby_auto.fish" >> ~/.config/fish/config.fish
echo "source "(brew --prefix)"/Cellar/chruby-fish/1.0.0/share/fish/vendor_functions.d/chruby.fish" >> ~/.config/fish/config.fish
echo "chruby ruby-3.2.2" >> ~/.config/fish/config.fish

source ~/.config/fish/config.fish

plbstl avatar Jul 30 '23 03:07 plbstl