Open clintmod opened 1 year ago
I'm having this same problem with XCode 14 on a M1 Macbook Pro.
EDIT: Realized I should mention that this problem does indeed go away if I downgrade to xCode 13. Would like to stay on xCode 14, however, as I want to test applications on an iPhone 14.
I am having this issue too. The fix that @clintmod provides it works.
Confirming only works with Xcode 13
Facing the same issue, too. Tried ruby versions 2.7.4, 2.7.6 and 3.1.2. Tried Xcode 14.0.1 and 13.4.1. Nothing works. Is there a specific Xcode 13 version I need to use?
@fabianmuecke I tried ruby 2.7.4 with Xcode 13.4.1. Don't forget to change Xcode select to 13 version.
Thanks @josorio-uber. In the end, the problem seemed to be related to my rbenv somehow. I uninstalled rbenv and installed Ruby 3.1.2p20 via brew. That solved the problem and I can now even use Xcode 14.0.1. No idea why, though. 🤷♂️
It's worth mentioning that once it's compiled with Xcode 13 the ruby_inline lib caches the results in ~/.ruby_inline/YOUR_RUBY_VERSION
so if you archive these somewhere you can reuse them. This would also let you upgrade to Xcode 14 as it won't try to compile it again. This is probably what @fabianmuecke is seeing.
[!] Your Podfile requires that the plugin cocoapods-keys
be installed. Please install it and try installation again.
I have this error in M1 MAX & Monterey 12.6.1 & XCode 14.1
I couldn't solve this problem with all possible solutions and I did all steps in this Article and setup "gem install cocoapods-keys" and I have the same error, however I have ruby version 3.1.2 please can any solve this problem ?!!
In my case I encountered this issue, trying to run pod install
under rbenv ruby 2.7.6 after having upgraded my M1 to macOS Ventura. This meant that I couldn't downgrade Xcode (or the Xcode command-line tools) to Xcode 13, as Ventura will not accept them. In the end I had to delete my hard drive and downgrade to macOS Monterey. I think this needs a real solution from within the gem, rather than these band-aid style workarounds. Neither use of Xcode 13 nor repeated use of arch -arch x86_64
is an acceptable option. Thx
@mattneub Thanks for your response I am already tried your steps but also failed.
After a quick look at different keychain gems, I'd recommend someone take a look at switching this gem to use https://rubygems.org/gems/ruby-keychain
I've managed to install and use cocoapods-keys on Apple M1 Max chip. It worked for me with System ruby installation combined with Xcode 13.4.1. I also tried out different ruby versions using rbenv, but without any luck.
The best is that I can still use arm64 terminal, and no need to start reinstalling everything under Rosetta. 🎉
OS details:
$ sw_vers
ProductName: macOS
ProductVersion: 12.6.1
BuildVersion: 21G217
$ uname -m
arm64
Ruby version
$ ruby -v
ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin21]
@kdlogen The problem is that if you're using macOS 13 (Ventura) there is no such thing as Xcode 13.
Totally same issue, it annoyed me for this whole week. Fortunately the error goes away this afternoon - although I'm not sure it was what that make it work. My last action is using brew to install rbenv, then use rbenv to install ruby 2.7.7, to replace the 2.7.6 installed by chruby.
We've had this problem in another gem that uses osx_keychain
. I think most of this was mentioned above, but I will summarise it all here:
osx_keychain
gem depends on RubyInline
RubyInline
allows you to run C code from rubyosx_keychain
uses it to interact with keychain APIRubyInline
generates some boilerplate C file from the coderuby.h
and uses some symbols from thereld
command doesn’t actually link ruby dylibld
command is generated by RubyInline
and takes LDFLAGS
from RbConfig
The key to getting it working under Xcode 14 is linking ruby library. We can force do that by specifying LDFLAGS in install command:
CFLAGS=-Wno-error=implicit-function-declaration LDFLAGS=-lruby rbenv install 3.0.3
Why this works under Xcode 13 I am not sure, maybe there was some change in clang's behaviour, but I couldn't find it.
I rewrote the plugin with another ruby-keychain gem. All tests are working too. I just didn't have time to test/implement it in my projects over the weekend (to validate legacy support). Just to let you know! :) https://github.com/orta/cocoapods-keys/pull/235
We solved the problem in our app by switching to another keychain gem, but on behalf of our entire company (unauthorized, this is just me talking) I'd like to thank @orta for making this utility available. It has done good service and our entire build process depended on it for years.
I just had to set up a couple of new m1 build machines and I couldn't get this gem to run the ruby-inline c++ code when running
pod install
with XCode 14.I was able to work around this by downgrading to Xcode 13.
Here was the error:
I actually tried to force an
x86_64
build to see if that would fix it witharch -x86_64 pod install
but it still complained about not being able to find the exact same symbols. I wonder if the ruby framework in Xcode 14 changed.Wanted to also mention that I'm installing ruby with
rbenv
and that I did downgrade ruby from 3 to 2 although I'm not sure that the ruby downgrade was required.