Thursday, September 16, 2021

Pod install fails in M1 chipset.

 Below error was receiving when attempting to pod install 


### Error


```

LoadError - dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi_c.bundle, 0x0009): could not use '/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi_c.bundle' because it is not a compatible arch - /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi_c.bundle

/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'

/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'

/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi.rb:5:in `rescue in <top (required)>'

/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi.rb:2:in `<top (required)>'

/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'

/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'

/Library/Ruby/Gems/2.6.0/gems/ethon-0.14.0/lib/ethon.rb:3:in `<top (required)>'

/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'

/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'

/Library/Ruby/Gems/2.6.0/gems/typhoeus-1.4.0/lib/typhoeus.rb:2:in `<top (required)>'

/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'

/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/sources_manager.rb:74:in `cdn_url?'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/sources_manager.rb:36:in `create_source_with_url'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/sources_manager.rb:21:in `find_or_create_source_with_url'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:178:in `block in sources'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:177:in `map'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:177:in `sources'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1073:in `block in resolve_dependencies'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1072:in `resolve_dependencies'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:124:in `analyze'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:414:in `analyze'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:239:in `block in resolve_dependencies'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:238:in `resolve_dependencies'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:160:in `install!'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command/install.rb:52:in `run'

/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334: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>'

```


――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――


[!] Oh no, an error occurred.


Search for existing GitHub issues similar to yours:

https://github.com/CocoaPods/CocoaPods/search?q=dlopen%28%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.3%2Flib%2Fffi_c.bundle%2C+0x0009%29%3A+could+not+use+%27%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.3%2Flib%2Fffi_c.bundle%27+because+it+is+not+a+compatible+arch+-+%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.3%2Flib%2Fffi_c.bundle&type=Issues


If none exists, create a ticket, with the template displayed above, on:

https://github.com/CocoaPods/CocoaPods/issues/new


Be sure to first read the contributing guide for details on how to properly submit a ticket:

https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md


Don't forget to anonymize any private data!


Looking for related issues on cocoapods/cocoapods...

 - M1 error running pod install

   https://github.com/CocoaPods/CocoaPods/issues/10904 [closed] [2 comments]

   2 days ago


 - Pod outdated error

   https://github.com/CocoaPods/CocoaPods/issues/10901 [closed] [3 comments]

   2 days ago


 - macBook m1 error run pod install

   https://github.com/CocoaPods/CocoaPods/issues/10903 [closed] [2 comments]

   a week ago


and 2 more at:

https://github.com/cocoapods/cocoapods/search?q=dlopen%28%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.3%2Flib%2Fffi_c.bundle%2C%200x0009%29%3A%20could%20not%20use%20%27%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.3%2Flib%2Fffi_c.bundle%27%20because%20it%20is%20not%20a%20compatible%20arch%20-%20%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.3%2Flib%2Fffi_c.bundle&type=Issues&utf8=✓

\W $pod install

Analyzing dependencies


――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――


### Command


```

/usr/local/bin/pod install

```


### Report


* What did you do?


* What did you expect to happen?


* What happened instead?



### Stack


```

   CocoaPods : 1.10.1

        Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.arm64e-darwin20]

    RubyGems : 3.2.21

        Host : macOS 11.4 (20F71)

       Xcode : 12.5.1 (12E507)

         Git : git version 2.30.1 (Apple Git-130)

Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib

Repositories : trunk - CDN - https://cdn.cocoapods.org/

```


### Plugins


```

cocoapods-deintegrate : 1.0.4

cocoapods-plugins     : 1.0.0

cocoapods-search      : 1.0.0

cocoapods-trunk       : 1.5.0

cocoapods-try         : 1.2.0

```


### Podfile


```ruby

source 'https://github.com/CocoaPods/Specs'




Below was to fix this issue 


$sudo arch -x86_64 gem install ffi

\W $arch -x86_64 pod install     



This installed the pods successfully 

Monday, September 6, 2021

Git rebasing multiple commits

git rebase -i HEAD~3

now on the window that displays all the commits and messages, change all expect the first one from pick to squash

 Typing "squash"

After the first step, the editor window will show up offering you to input the command for each commit. All you need to do is replacing pick with squash, starting from the second line. Then, save the file.

This will do the rebase operation. 

Now to push it, do the below 

git push --force-with-lease origin HEAD

references

https://www.w3docs.com/snippets/git/how-to-combine-multiple-commits-into-one-with-3-steps.html