Open ndevev opened 2 weeks ago
I have the exact issue; trying to recompile and build a project for customer after clean mac sonoma install ad installing xcode 15.4
CocoaPods : 1.11.3
Ruby : ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-darwin23]
RubyGems : 3.0.1
Host : macOS 14.4.1 (23E224)
Xcode : 15.4 (15F31d)
Git : git version 2.39.3 (Apple Git-146)
Ruby lib dir : /Users/Stefano/.rbenv/versions/2.6.0/lib
Repositories : trunk - CDN - https://cdn.cocoapods.org/
REXML::ParseException - #<TypeError: wrong argument type String (expected Regexp)>
The issue seems to be related to rexml: https://github.com/ruby/rexml/issues/142 rexml has been updated to fix the issue in new version 3.3.0 I don't know how to force cocoapods to use new library version, can someone please indicate how to do it?
@ndevev
I am also having same exact issue ,have been trying this for hours
@ndevev @anusha-chromosis
I managed to complete pod install
. Here the steps:
Gemfile.lock
and xcodeproj.gemspec
changing rexml version to 3.3.0rake build
gem install rexml -v 3.3.0
(I did this with and without sudo)gem install --local pkg/xcodeproj-1.24.0.gem
(I did this with and without sudo)pod install
in project folder and now completes normallyhttps://github.com/CocoaPods/Xcodeproj/pull/944 will solve this.
Could you show the output of gem list
?
The following command lines may be another workaround:
$ sudo gem install rexml -v 3.2.6
$ sudo gem uninstall rexml -v 3.2.9
The following command lines may be another workaround:
$ sudo gem install strscan
The context of my problem was that I was getting the error while running a Flutter app with plugins. The default one didn't gave me any problem. Also, I was getting the exact same issue that the original issue poster, same Ruby version, same lines, etc., but on an M1 device.
In my situation, the problem was solve once I removed cocoapods completely and then installed it again. I'm a new MacOS user so I think this was my fault while trying to configure my environment.
I remove it using:
$ brew uninstall cocoapods
But I was still getting a result while executing:
$ pod --version
Then I use:
$ which pod
To find the path of the pods installation that was still on the computer.
So I executed:
sudo rm /usr/local/bin/pod
Then I run pod --version to make sure it was completely deleted. I installed it again using:
$ brew install cocoapods
Then I run the app again and it worked. Hope this helps someone.
It happened when I was trying to set up a new MacBook Air. I couldn't solve it so I went back to the factory default and then migrated everything from my old one. And this worked well. So I can't send the gem list. Anyway, thanks to everyone, the suggestions here will come in handy later.
Could you show the output of
gem list
?The following command lines may be another workaround:
$ sudo gem install rexml -v 3.2.6 $ sudo gem uninstall rexml -v 3.2.9
The following command lines may be another workaround:
$ sudo gem install strscan
great, thx
The reason you're seeing this error is because you're using the system Ruby (the Ruby version that came preinstalled on your Mac), or a version of Ruby older than 3.x that you installed yourself. Instead, I highly recommend using a version manager (such as chruby, rbenv, asdf) to install a newer and separate Ruby version that won't have this rexml issue.
The solutions offered here so far might work, but they are far from ideal, and can cause other issues. I've written popular articles that explain Why You Should Never Use sudo to Install Ruby Gems and Why You Shouldn't Use the System Ruby to Install Gems on a Mac.
To understand why this REXML error happens with older Ruby versions, and how to properly install a newer version of Ruby, read my latest article: How to fix REXML::ParseException TypeError in Cocoapods.
Command
Report
What did you do?
What did you expect to happen?
What happened instead?
Stack
Plugins
Podfile
Error