Freezing gems other than Rails

I came across Topfunky’s rake task that can be used to freeze gems that is not related to Rails. But it seems to be outdated, so I read this

How do I get the gems that is used by the Rails app to the vendor gems directory? Does anyone have step-by-step instructions? TIA.

It's actually in the article you referenced. You need to manually
create the gems data and bin directories in vendor.

Read the comments carefully, I'm not sure that the questions about how
to properly handle gems which need building of C extensions was
answered, and I don't see where the issue of dealing with deploying to
a different platform type than the development machine was even asked.