The app thinning fails with:
The operation couldn’t be completed. (AppThinning.StubError error 1.)
XCode version: 14.2 (14C18) Device: Macbook Air M1
In logs there is something that looks like an error:
2023-04-05 07:45:24 +0000 Output: ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.x86_64-darwin21]
/Applications/Xcode.app/Contents/SharedFrameworks/AppThinning.framework/Resources/ipatool:4135: warning: assigned but unused variable - prev
/Library/Ruby/Gems/2.6.0/gems/CFPropertyList-3.0.6/lib/cfpropertylist/rbCFPropertyList.rb:83: warning: assigned but unused variable - temp
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:65:in `require': dlopen(/Library/Ruby/Gems/2.6.0/gems/date-3.3.3/lib/date_core.bundle, 0x0009): tried: '/Library/Ruby/Gems/2.6.0/gems/date-3.3.3/lib/date_core.bundle' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64))) - /Library/Ruby/Gems/2.6.0/gems/date-3.3.3/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:65:in `require'
from /Library/Ruby/Gems/2.6.0/gems/date-3.3.3/lib/date.rb:4:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:65:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:65:in `require'
from /Library/Ruby/Gems/2.6.0/gems/CFPropertyList-3.0.6/lib/cfpropertylist/rbCFPropertyList.rb:4:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:65:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:65:in `require'
from /Library/Ruby/Gems/2.6.0/gems/CFPropertyList-3.0.6/lib/cfpropertylist.rb:3:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:130:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:130:in `rescue in require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:34:in `require'
from /Applications/Xcode.app/Contents/SharedFrameworks/AppThinning.framework/Resources/ipatool:15:in `<main>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- cfpropertylist (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'
from /Applications/Xcode.app/Contents/SharedFrameworks/AppThinning.framework/Resources/ipatool:15:in `<main>'
2023-04-05 07:45:24 +0000 JSON: error: Error Domain=NSCocoaErrorDomain Code=260 "The file “ipatool.json” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/var/folders/_l/gkxd9_pd1tg8qgd4rtxxy5kw0000gn/T/IPATool.bIAtDE9/ipatool.json, NSUnderlyingError=0x60000be9e280 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
I've tried installing this date gem by running
sudo arch -x86_64 gem install date
but I also have rbenv setup and in uses different version of ruby (3.2.1). But still this command has failed with
Undefined symbols for architecture x86_64:
"_rb_alloc_tmp_buffer_with_count", referenced from:
_s3e in date_parse.o
_read_digits in date_strptime.o
"_rb_ary_new_capa", referenced from:
_Init_date_core in date_core.o
"_rb_ary_new_from_args", referenced from:
_d_lite_marshal_dump in date_core.o
_rt_complete_frags in date_core.o
"_rb_ary_push", referenced from:
_Init_date_core in date_core.o
"_rb_backref_get", referenced from:
_date__parse in date_parse.o
_date__iso8601 in date_parse.o
_date__rfc3339 in date_parse.o
_date__xmlschema in date_parse.o
_date__rfc2822 in date_parse.o
_date__httpdate in date_parse.o
_date__jisx0301 in date_parse.o
...
You are running an x86_64 version of Ruby rather than arm64. You can tell from this line:
And this line:
Additionally you say you've installed Ruby 3.2.1 through rbenv but all your error messages are referencing system Ruby with version 2.6.8 -- the version that ships with macOS -- and not rbenv's version.
You've gotten yourself into a deep hole. You've managed to mix up:
sudoinstalled libraries and non-sudoinstalled librariesAny one of those on their own is a painful process to unwind. All three at once is kind of a nightmare. While the following instructions are meant to help dig you out of the hole that you're in they aren't 100% prescriptive and some will apply to your situation and some may not. I suggest using these as a framework to troubleshoot and resolve the problems you're having.
First off, it's safe to assume that you did not properly and completely follow the installation instructions for rbenv. You should:
archand ensure it saysarm64If you see
i386then your Terminal is running with Rosetta emulation and that needs to be disabled so that all your commands run as native arm64 commands. To fix this:/Applications/Utilitiesarchagain and confirm it saysarm64Then continue with the following steps:
gem uninstall -aIxto uninstall all the gems that you previously installed under system Rubysudo gem uninstall -aIxto uninstall all the gems that you previously installed usingsudo(and then never usesudoever again when running any kind of Ruby commands; usingsudohas been a major contributor to your problems and will break things)which rubyto confirm it is pointing to rbenv's version of RubyOne last thing to take into consideration is that the operation that you're running may be starting a non-interactive shell and not loading your shell configuration. If your shell configuration isn't loaded then rbenv won't be loaded and when that shell looks for
rubyit's going to find system Ruby, which you don't want to have happen. You may have to do this operation manually in a terminal window rather than automatically to ensure it loads through an interactive shell.It's also possible that it's loading an alternative shell, like bash, when your normal shell is zsh. If that's the case then when you're configuring rbenv you need to follow the instructions for both bash and zsh so that when it loads bash it also loads rbenv. (or for any other shells you might be using instead)