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
😝Big guys go to docker,There is no such messy problem!
docker pull ruby:alpine ✅
Oh? Can it still be used like this? Docker configures the environment,Then use it on a real machine?
Of course it can。JB home can set up remote interpreter or something,Even if you use docker on the remote vm, you can,You mount it again,Perfect~