Similar to npm add module --save to add a node package to the package.json file, you can use bundle to download, install and save a gem to the Gemfile.
npm add module --save
bundle add {gem} {version}
# examples bundle add pdf-reader "2.4" bundle add pdf-reader