Automatically run 'bundle install' if a gem binary crashes because gems are missing

100 views
Skip to first unread message

Nathan Broadbent

unread,
Dec 12, 2013, 2:57:42 PM12/12/13
to ruby-b...@googlegroups.com
Hello,

For the past year or so I've been running a script that detects the 'GemNotFound' error code, and automatically runs 'bundle install' before retrying the command. I've found this to be super useful, and it saves a lot of time by automating a very common task. I 'git pull' some changes, run a rails or rake command, and any new gems are automatically installed before running the command.


I would like to suggest adding this as a Bundler feature. Maybe a new config option, such as: bundle config auto_install true
If this was enabled, any time a `bundle exec` or `Bundler.require` fails with missing gems, Bundler would run 'bundle install', and then retry the command / require. If it fails a second time, then raise the error.

Please let me know what you think.


Best,
Nathan Broadbent
Reply all
Reply to author
Forward
0 new messages