postmodern / chruby

Changes the current Ruby
MIT License
2.85k stars 190 forks source link

"chruby: unknown Ruby: ruby-3.1.2" was shown everytime launch terminal #484

Closed toeverrise closed 1 year ago

toeverrise commented 1 year ago

While I'm following the steps of https://jekyllrb.com/docs/installation/macos/, I copied the comand (for several times)

echo "source $(brew --prefix)/opt/chruby/share/chruby/chruby.sh" >> ~/.zshrc echo "source $(brew --prefix)/opt/chruby/share/chruby/auto.sh" >> ~/.zshrc echo "chruby ruby-3.1.2" >> ~/.zshrc without noticing 3.1.2 should be 3.1.3 now.

Now my terminal starts with chruby: unknown Ruby: ruby-3.1.2(for several times) everytime I opens terminal, I have no idea how to get rid of it.

I'm using MacOS Monterey 12.5, chruby installed.

I'm new to coding, sorry if this sounds silly!

postmodern commented 1 year ago

You will either need to make sure ruby-3.1.2 is installed with ruby-install ruby-3.1.2, or update your ~/.zshrc to use chruby ruby-3.1 which will switch to any 3.1 ruby version, or just use jekyll with system ruby. Most all Linux and macOS systems should have a relatively up-to-date version of ruby available, so installing/using a specific version of ruby and using chruby/rbenv/rvm is not really necessary.

toeverrise commented 1 year ago

Thanks for answering!

My terminal is using ruby-3.1.3 already, however, the terminal still pops up chruby: unknown Ruby: ruby-3.1.2 everytime I lauch terminal. I have tried numerous way but couldn’t remove them, would you like to shed a light on this?

Thanks!

postmodern commented 1 year ago

@toeverrise the error is probably caused by the directions telling you to add chruby ruby-3.1.2 to your ~/.zshrb file. Simply edit your ~/.zshrc file and change ruby-3.1.2 to either ruby-3.1.3 or ruby-3.1 so that chruby selects ruby-3.1.3 which should be installed.

toeverrise commented 1 year ago

I fixed it!! Thanks so much for your patience ;))