chruby-fish: My setup suddenly stopped working - won't update $PATH variable

chruby-fish suddenly stopped working for me … I’m not sure what changed on my system or what triggered it. And I’m having a hard time debugging it! Can you help me figure out what is going wrong ?

Here is an example of what’s happening using fish:

~ ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
~ source /usr/local/share/chruby/chruby.fish
~ chruby --version
chruby: 0.3.9
chruby-fish: 0.8.1
~ chruby
   ruby-2.3.0
   ruby-2.4.4
   ruby-2.5.0
~ chruby 2.4.4
~ ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
~ echo $PATH
/usr/local/bin /usr/bin /bin /usr/sbin /sbin 

As you can see above the environmental variables are not being updated – when I switch my shell to bash, however, everything works as expected.

here is an example using bash

:~$ ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
:~$ source /usr/local/share/chruby/chruby.sh
:~$ chruby --version
chruby: 0.3.9
:~$ chruby
   ruby-2.3.0
   ruby-2.4.4
   ruby-2.5.0
:~$ chruby 2.4.4
:~$ ruby -v
ruby 2.4.4p296 (2018-03-28 revision 63013) [x86_64-darwin17]
:~$ echo $PATH
/Users/damon/.gem/ruby/2.4.4/bin:/Users/damon/.rubies/ruby-2.4.4/lib/ruby/gems/2.4.0/bin:/Users/damon/.rubies/ruby-2.4.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

workaround

For now I’ve had to copy the $PATH output from the bash shell and create an alias in fish to load the correct ruby $PATH – this allows me to use the different rubies … however, as you can imagine, this is not ideal.

Any ideas about how I can go about sorting what went wrong ? I’ve tried removing and reinstalling view homebrew but no luck.

Thanks.

PS - I think the only thing I installed between when it was and was not working is VMWare Fusion; which did add a line to the $PATH … but it was in both bash and fish so I’m not sure why one would work and the other not.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 19 (13 by maintainers)

Most upvoted comments

It also stopped working for me. I haven’t used it in a while but somehow now I’m always stuck with the system ruby on OSX and chruby seems to do nothing.