0

How can I resolve the message Warning: CocoaPods is installed but broken. Skipping Pod install. You appear to have cocoa pods installed but its not working.?

The issue:

  • It works fine if I create a new project and run it on IOS but from the previous projects it doesn't work on IOS.
  • If I open the runner file from Xcode it launches but doesn't launch from android studio.

Therefore, when do pod install in the file it gives me this error:

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require': dlopen(/Library/Ruby/Gems/2.6.0/gems/date-3.2.2/lib/date_core.bundle, 0x0009): tried: '/Library/Ruby/Gems/2.6.0/gems/date-3.2.2/lib/date_core.bundle' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')) - /Library/Ruby/Gems/2.6.0/gems/date-3.2.2/lib/date_core.bundle (LoadError) from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require'

So can you explain how can I resolve this error?

Christian
  • 4,902
  • 4
  • 24
  • 42
Race car
  • 1
  • 1
  • Does this answer your question? [How can I fix this psych error reading ruby and cocoapods?](https://stackoverflow.com/questions/73085362/how-can-i-fix-this-psych-error-reading-ruby-and-cocoapods) – Christian Aug 01 '22 at 22:45

1 Answers1

0

From: https://github.com/flutter/flutter/issues/54962#issuecomment-635443559

Resolved: Turns out it wasn't an issue with cocoapods per se. I did three things:

  1. sudo gem update
  2. I fired up Xcode which I had forgotten I had updated and it required additional components to be installed.
  3. I restarted visual studio code

After that everything worked just fine.

Christian
  • 4,902
  • 4
  • 24
  • 42
  • But I get this error Before reporting this, could you check that the file you're documenting has proper syntax: /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -c ext/libxml/extconf.rb RDoc is not a full Ruby parser and will fail when fed invalid ruby programs. The internal error was: (NoMethodError) undefined method `[]' for nil:NilClass ERROR: While executing gem ... (NoMethodError) undefined method `[]' for nil:NilClass – Race car Jul 09 '22 at 18:25
  • Try to reinstall rdoc: https://github.com/ruby/rdoc/issues/786#issuecomment-757450232 – Christian Jul 09 '22 at 22:16
  • Or skip the rdoc installation: https://stackoverflow.com/questions/9562582/issue-occurring-while-installing-gem – Christian Jul 09 '22 at 22:17
  • So I tried that but I still get this warning – Race car Jul 10 '22 at 22:52
  • dlopen(/Library/Ruby/Gems/2.6.0/gems/psych-4.0.4/lib/psych.bundle, 0x0009): tried: '/Library/Ruby/Gems/2.6.0/gems/psych-4.0.4/lib/psych.bundle' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')) - /Library/Ruby/Gems/2.6.0/gems/psych-4.0.4/lib/psych.bundle (LoadError) from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:117:in `require' from /Library/Ruby/Gems/2.6.0/gems/psych-4.0.4/lib/psych.rb:13:in `' – Race car Jul 10 '22 at 22:53
  • So how can I fix this – Race car Jul 19 '22 at 15:02
  • A follow up question have been posted: https://stackoverflow.com/questions/73085362/how-can-i-fix-this-psych-error-reading-ruby-and-cocoapods – Christian Aug 01 '22 at 22:46