1

I've been following the Flutter install doc at https://docs.flutter.dev/get-started/install/macos/mobile-ios.

When trying to install cocoapods using "sudo gem install cocoapods", I get that "the last version of (SOME APP; VARIES) to support your Ruby & RubyGems was (VERSION). ... (SAID APP) requires Ruby version >= 3.1.0. The current ruby version is 2.6.10.210."

So I thought I should update rubygems.

At rubygems.org, "gem 'algolia', '~> 3.15', '>= 3.15.4'" is not recognized in Terminal ("unknown command algolia"). If I go straight to "gem install algolia" I get the first error again.

Any help would be appreciated.

3
  • 2
    You need to update your ruby (not rubygems). "requires Ruby version >= 3.1.0. The current ruby version is 2.6.10.210" Commented Apr 22 at 20:59
  • 1
    @engineersmnky Thanks for pointing me in the right direction. Yes, it turns out I did not read/interpret the error carefully enough; Ruby (not rubygems) first and foremost needed updating. I installed the newest Ruby version using Homebrew (I read I shouldn't interfere with the Ruby installation that came with macOS), and then updated Algolia and installed cocoapods without issue. Commented Apr 23 at 1:55
  • 2
    As a rule of thumb, don't use sudo when installing gems. For CocoaPods, it's only necessary when using system Ruby. Since you are installing your own Ruby (as recommended), you can/should use gem install cocoapods as shown in the install guide. Commented Apr 23 at 7:45

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.