chruby-fish
chruby-fish copied to clipboard
Ruby is unselected when cd'ing out of a directory with a .ruby-version file
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?
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?
@JeanMertz Any updates on this?
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