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

osx_keychain fails on M1 Macs #5

Closed
DreamingInBinary opened this issue Feb 24, 2021 · 5 comments
Closed

osx_keychain fails on M1 Macs #5

DreamingInBinary opened this issue Feb 24, 2021 · 5 comments

Comments

@DreamingInBinary
Copy link

I noticed while attempting to use Cocoapod's cocoapods-keys plugin that it would fail with this error:

LoadError - dlopen(/Users/jordanmorgan/.ruby_inline/ruby-2.7.0/Inline_OSXKeychain_5b2f8d1cd1bde9c4ff3fea49f09cd5c1.bundle, 9): no suitable image found.  Did find:
	/Users/jordanmorgan/.ruby_inline/ruby-2.7.0/Inline_OSXKeychain_5b2f8d1cd1bde9c4ff3fea49f09cd5c1.bundle: mach-o, but wrong architecture

Which led me to try and use this library by itself, which does indeed crash out:

jordanmorgan@Jordans-MacBook-Air ~ % osx_keychain
Traceback (most recent call last):
	10: from /Users/jordanmorgan/.rbenv/versions/2.7.2/bin/osx_keychain:23:in `<main>'
	 9: from /Users/jordanmorgan/.rbenv/versions/2.7.2/bin/osx_keychain:23:in `load'
	 8: from /Users/jordanmorgan/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/osx_keychain-1.0.2/bin/osx_keychain:3:in `<top (required)>'
	 7: from /Users/jordanmorgan/.rbenv/versions/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	 6: from /Users/jordanmorgan/.rbenv/versions/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	 5: from /Users/jordanmorgan/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/osx_keychain-1.0.2/lib/osx_keychain.rb:6:in `<top (required)>'
	 4: from /Users/jordanmorgan/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/osx_keychain-1.0.2/lib/osx_keychain.rb:16:in `<class:OSXKeychain>'
	 3: from /Users/jordanmorgan/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/RubyInline-3.12.5/lib/inline.rb:860:in `inline'
	 2: from /Users/jordanmorgan/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/RubyInline-3.12.5/lib/inline.rb:526:in `load'
	 1: from /Users/jordanmorgan/.rbenv/versions/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/Users/jordanmorgan/.rbenv/versions/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require': dlopen(/Users/jordanmorgan/.ruby_inline/ruby-2.7.0/Inline_OSXKeychain_5b2f8d1cd1bde9c4ff3fea49f09cd5c1.bundle, 9): no suitable image found.  Did find: (LoadError)
	/Users/jordanmorgan/.ruby_inline/ruby-2.7.0/Inline_OSXKeychain_5b2f8d1cd1bde9c4ff3fea49f09cd5c1.bundle: mach-o, but wrong architecture
	/Users/jordanmorgan/.ruby_inline/ruby-2.7.0/Inline_OSXKeychain_5b2f8d1cd1bde9c4ff3fea49f09cd5c1.bundle: mach-o, but wrong architecture - /Users/jordanmorgan/.ruby_inline/ruby-2.7.0/Inline_OSXKeychain_5b2f8d1cd1bde9c4ff3fea49f09cd5c1.bundle

It appears that in line 23, when loading up CoreFoundation, the error occurs.

I'm not sure if there is a fix for this or not, but if there's anything I can do to help - I'm happy to!

@zenspider
Copy link
Member

zenspider commented Feb 25, 2021 via email

@DreamingInBinary
Copy link
Author

@zenspider you're right, I initially couldn't get rbenv to install another Ruby version. Going all the way back and installing Homebrew and friends using arch -x86_64 fixed this and several other issues.

Closing this down, thanks for responding!

@zenspider
Copy link
Member

zenspider commented Feb 27, 2021 via email

@DreamingInBinary
Copy link
Author

For me, I was using Ruby 7.2.x. When I suspected I needed another version, my first hint that something was off was that rbenv would fail any installation of Ruby.

Reinstalling Homebrew and rbenv, and finally getting this version of Ruby:
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]

Fixed my issue. ffi, among others, would fail with a similar error above.

@sawalon
Copy link

sawalon commented Nov 5, 2022

orta/cocoapods-keys#217 (comment)
fixed my issue.

@seattlerb seattlerb locked as resolved and limited conversation to collaborators Nov 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants