Sometimes you need to install a gem in your Rails application for distribution.
If it’s installed as a Ruby gem in your system and you need it to be packaged with the Rails application (/lib or /vendor/plugins directories), go to the target folder and do
$ gem unpack gem_name
If it’s not installed yet, you need to install it first like below and then do unpacking.
$ gem install gem_name
I also found several pages that may be interesting: