IOS remembers the Ruby version and Cocoapods version (Malformed version number string)

foreword

Recently, because I wanted to install Flutter, I updated the ruby ​​version to 2.7.7. Then the crash started for a few hours, various compilations failed, and Malformed version number string was always reported.

resolution process

1. First searched for the problem and found a solution to the problem https://github.com/CocoaPods/CocoaPods/issues/7765 .
My version number problem:

   CocoaPods : 1.5.3
        Ruby : ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
    RubyGems : 2.7.7

In the solution, someone said that the RubyGems version number will be rolled back to 2.7.6,
insert image description here
but my problem has not been solved, so what should I do?
Then I saw another solution (RVM is a Ruby version management tool, the same as Rbenv, if there are students who don’t understand it, go to make up for this knowledge) Then I downloaded
insert image description here
my ruby ​​version to a 2.4.1 version, Then use rbenv to choose the terminal to use version 2.4.1, and then continue to execute my Cocoapods.
Problem solved! ! ! ! ! ! ! ! ! ! This is really a pit, no one knows the ruby ​​version corresponding to the Cocopods version. All remember, don't upgrade ruby ​​indiscriminately, that's all.

Guess you like

Origin blog.csdn.net/sky_long_fly/article/details/89241754