Add gem to gemfile with bundler from command line

sren picture sren · Nov 4, 2011 · Viewed 30.9k times · Source

When using node package manager you can specify npm install --save mynodemodule which automatically pops the module in package.json

I was wondering if there is a command for bundler that allows you to add the gem and version to the gemfile from the command line?

For example bundle install --save nokogiri

Answer

Dru picture Dru · Jun 12, 2013

Just wrote Gemrat to do this.

    $ gem install gemrat 
    $ gemrat nokogiri

    #=> gem 'nokogiri', '1.6.0' added to your Gemfile.
    #=> Bundling...