Gem install can't find binary after updating Ruby

I always use rbenv,Until this time after updating cocoapods,Execution error,of course,Visual inspection should be caused by my ruby ​​environment being too old,So I tried rbenv install 3.0.2 ,But unfortunately,Reported an error,Go to the official warehouse of rbenv to take a look,The last version is still 2019...Okay,Give it up,After deleting all the versions,I found that I have been using brew to install the latest version of ruby,Just use it directly。

But encountered a problem,After installing gem using this ruby,All successfully installed gems cannot find executable files。Obviously,The operating environment in the installation prompt of brew is wrong,Here we first use which gem Confirm that the implementation is our newly installed version,Instead of the ruby ​​version that comes with macOS。Then gem env View the current operating environment,Find one of the fields - EXECUTABLE DIRECTORY: The path here is the path of the executable file,Just add the path after this to your shell,It's perfect。

of course,You can also use the command gem environment is a gem Direct output。

Original article written by LogStudio:R0uter's Blog » Gem install can't find binary after updating Ruby

Reproduced Please keep the source and description link:https://www.logcg.com/archives/3524.html

About the Author

R0uter

The non-declaration,I have written articles are original,Reproduced, please indicate the link on this page and my name。

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *