Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
paddor opened this issue Jan 18, 2023 · 4 comments

Comments

@paddor
Copy link

paddor commented Jan 18, 2023

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
Copy link
Author

paddor commented Feb 7, 2023

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
Copy link
Author

paddor commented Apr 27, 2023

@JeanMertz Any updates on this?

@plbstl
Copy link

plbstl commented Jul 30, 2023

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

@mhenrixon
Copy link

I wonder if this is the same issue as : DarthSim/overmind#127 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants