Entire error I got as below, but on Mac:
/Users/mayuresh.srivastava/.rvm/gems/ruby-2.7.3/gems/ffi-1.15.4/lib/ffi.rb:3:in `require': cannot load such file -- 2.7/ffi_c (LoadError)
/Users/mayuresh.srivastava/.rvm/gems/ruby-2.7.3/gems/ffi-1.15.4/lib/ffi.rb:5:in `require': dlopen(/Users/mayuresh.srivastava/.rvm/gems/ruby-2.7.3/gems/ffi-1.15.4/lib/ffi_c.bundle, 9): Library not loaded: /opt/homebrew/opt/libffi/lib/libffi.7.dylib (LoadError)
Referenced from: /Users/mayuresh.srivastava/.rvm/gems/ruby-2.7.3/gems/ffi-1.15.4/lib/ffi_c.bundle
Reason: image not found - /Users/mayuresh.srivastava/.rvm/gems/ruby-2.7.3/gems/ffi-1.15.4/lib/ffi_c.bundle
I checked ffi, it was already there:
mayuresh.srivastava$ gem list ffi
*** LOCAL GEMS ***
ffi (1.15.4)
public_suffix (4.0.6)
Still I installed ffi again, and it worked.
mayuresh.srivastava$ gem install ffi
Building native extensions. This could take a while...
Successfully installed ffi-1.15.4
Parsing documentation for ffi-1.15.4
Installing ri documentation for ffi-1.15.4
Done installing documentation for ffi after 11 seconds
1 gem installed
ffi
gem version ? – Nichol