cocoapods-keys: Error loading plugin on M1 mac
I’ve just gotten an M1 mac and trying to install everything and run a project that uses cocoapods keys. Its working if I run pod install with
arch -x86_64 pod install
Other users on this thread: https://github.com/CocoaPods/CocoaPods/issues/9907 are reporting that if you update the pre-installed ruby version to at least 2.7.3, that it all works natively without the new for arch -x86_64. However when I do that, i get an error that ruby_inline/ruby-2.6.0 is not compatible.
% pod install
---------------------------------------------
Error loading the plugin `cocoapods-keys-2.2.1`.
LoadError - dlopen(/Users/simonmcloughlin/.ruby_inline/ruby-2.6.0/Inline_OSXKeychain_5b2f8d1cd1bde9c4ff3fea49f09cd5c1.bundle, 0x0009): could not use '/Users/simonmcloughlin/.ruby_inline/ruby-2.6.0/Inline_OSXKeychain_5b2f8d1cd1bde9c4ff3fea49f09cd5c1.bundle' because it is not a compatible arch - /Users/simonmcloughlin/.ruby_inline/ruby-2.6.0/Inline_OSXKeychain_5b2f8d1cd1bde9c4ff3fea49f09cd5c1.bundle
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/RubyInline-3.12.5/lib/inline.rb:526:in `load'
/Library/Ruby/Gems/2.6.0/gems/RubyInline-3.12.5/lib/inline.rb:860:in `inline'
/Library/Ruby/Gems/2.6.0/gems/osx_keychain-1.0.2/lib/osx_keychain.rb:17:in `<class:OSXKeychain>'
/Library/Ruby/Gems/2.6.0/gems/osx_keychain-1.0.2/lib/osx_keychain.rb:6:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-keys-2.2.1/lib/keyring.rb:1:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-keys-2.2.1/lib/cocoapods_plugin.rb:1:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command/plugin_manager.rb:94:in `block in safe_activate_and_require'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command/plugin_manager.rb:94:in `each'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command/plugin_manager.rb:94:in `safe_activate_and_require'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command/plugin_manager.rb:31:in `block in load_plugins'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command/plugin_manager.rb:30:in `map'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command/plugin_manager.rb:30:in `load_plugins'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:326:in `block in run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:325:in `each'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:325:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
---------------------------------------------
I know nothing bout ruby or these tools. I’m assuming the inline version of ruby needs to be updated. Is this something you could do and cut a new release?
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 27 (1 by maintainers)
Thanks to @xanderbuck and @jiayangmiao You don’t need to use arch command. Just install ruby
2.7.32.7.3ruby -vwas saying 2.7.3gem install cocoapods cocoapods-keyspod install@midhetfatema94 Thank you very much for the reply!
Even though I made it work without doing what you did, I figured this might help someone else and here is the steps I taken. Nothing was run by rosetta, all just normal terminal in arm64
Hi, I’ve tried the solution described above that involves installing Ruby 2.7.3 with
rbenv. When doing so, I get an error (see below). Is the solution above still valid for latest version of macOS? Should I consider dropping this plugin for development on M1 machines?Error:
Current setup: Macbook Pro M1 Max macOS Monterey 12.4
I got it to work using Homebrew, rbenv and bundler all of it with arch commands. No Rosetta needed. I can share it if anyone would like it.
Your Podfile requires that the plugin
cocoapods-keysbe installed. Please install it and try installation again.I have this error in M1 MAX & Monterey 12.6.1 & Xcode 14.1 & ruby version 3.1.2
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 Can anyone solve this problem ?!!
Hi @jiayangmiao @simonmcl
The thing I actually did was open Terminal in Rosetta. (You can Click Cmd+option+i) in the Finder after selecting Terminal. This run the cocoapods-key plugin without any problems but did not make any changes. So I then cloned my repo on my Intel Macbook > installed the key > airdropped it to my m1! I realize that this solution is not optimal, I had to do what I had to do 🙈
Okay @simonmcl, I think try opening the terminal with Rosetta and it will work for you! It worked for me 😊
@xanderbuck These are the steps I used. I attached the file. I hope it helps someone else. 10/29/2021 HowToSetupCocoapodskeys.txt
If after doing that you have any problem with LLDB in Xcode, please run
chsh -s /bin/bash. It did not happen to me, but to my colleague. Just in case.Credits to https://github.com/igorcferreira
Update: 10/28/21
I tried every suggestion after many hours of troubleshooting and the only solution that worked for me was following @jiayangmiao instructions above. Make sure you install ruby
2.7.3. I thought I could get by with version 2.7.4 but that didn’t work. If you don’t have any experience with rbenv like me, I found this tutorial helpful here.