Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'pod init' and 'pod install' both fail with "can't modify frozen String (FrozenError)" #11594

Closed
patrickmay opened this issue Oct 11, 2022 · 4 comments

Comments

@patrickmay
Copy link

Report

What did you do?

I ran 'pod init' on an Intel MacBook Pro running macOS 12.5.1 and the latest Xcode.

What did you expect to happen?

I expected a Podfile to be created.

What happened instead?

I got this error:

/usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/user_interface/error_report.rb:34:in `force_encoding': can't modify frozen String (FrozenError)
	from /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/user_interface/error_report.rb:34:in `report'
	from /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:66:in `report_error'
	from /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/claide-1.1.0/lib/claide/command.rb:396:in `handle_exception'
	from /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/claide-1.1.0/lib/claide/command.rb:337:in `rescue in run'
	from /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/claide-1.1.0/lib/claide/command.rb:324:in `run'
	from /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
	from /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
	from /usr/local/Cellar/cocoapods/1.11.3/libexec/bin/pod:23:in `load'
	from /usr/local/Cellar/cocoapods/1.11.3/libexec/bin/pod:23:in `<main>'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.21.0/lib/xcodeproj/project.rb:228:in `initialize_from_file': [Xcodeproj] Unknown object version (56). (RuntimeError)
	from /Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.21.0/lib/xcodeproj/project.rb:113:in `open'
	from /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/command/init.rb:41:in `validate!'
	from /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/claide-1.1.0/lib/claide/command.rb:333:in `run'
	from /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
	from /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
	from /usr/local/Cellar/cocoapods/1.11.3/libexec/bin/pod:23:in `load'
	from /usr/local/Cellar/cocoapods/1.11.3/libexec/bin/pod:23:in `<main>'

I've tried uninstalling and reinstalling Cocoapods, but as a gem and from homebrew. Neither work.

CocoaPods Environment

### Stack

CocoaPods : 1.11.3
Ruby : ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.x86_64-darwin21]
RubyGems : 3.0.3.1
Host : macOS 12.5.1 (21G83)
Xcode : 14.0.1 (14A400)
Git : git version 2.37.0 (Apple Git-136)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories : trunk - CDN - https://cdn.cocoapods.org/


### Installation Source

Executable Path: /usr/local/Cellar/cocoapods/1.11.3/libexec/bin/pod


### Plugins

cocoapods-deintegrate : 1.0.5
cocoapods-plugins : 1.0.0
cocoapods-search : 1.0.1
cocoapods-trunk : 1.6.0
cocoapods-try : 1.2.0

@patrickmay
Copy link
Author

I found another ticket that suggested sudo gem update xcodeproj. That seems to have fixed the problem.

@Panway
Copy link

Panway commented Jan 5, 2023

gem update xcodeproj works for me(I use rbenv to manage ruby).

my error is

...
/Users/xxx/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/xcodeproj-1.21.0/lib/xcodeproj/project.rb:228:in `initialize_from_file': [Xcodeproj] Unknown object version (56). (RuntimeError)
...
/Users/xxx/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface/error_report.rb:34:in `force_encoding': can't modify frozen String: "[Xcodeproj] Unknown object version (56)." (FrozenError)
...

@jackcoral89
Copy link

Also works for me sudo gem update.

Thanks @patrickmay

@LarryLib
Copy link

xcodeproj

sudo gem update xcodeproj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants