gem

Use bundle to add gems to Gemfile

Snippet

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.

bundle add {gem} {version}
# examples
bundle add pdf-reader "2.4"
 
bundle add pdf-reader 

What gems are installed?

Snippet

Have a Gemfile or a Gemfile.lock and want to see what versions are installed.

gem list

Specify local gem in Gemfile

Snippet

Specify a specific ruby gem file to use, typically development and local, instead of the default installed version.

gem "foo", :path => "/path/to/foo"