mipmip
mipmip

Reputation: 1160

Don't reinstall if gem is already installed

How can I prevent gem install to not reinstall a Gem if the same version is already installed?

Upvotes: 1

Views: 386

Answers (2)

RossMc
RossMc

Reputation: 426

You can use the --conservative flag with gem install.

gem install sqlite -v 1.3.8 --conservative

It won't install or update any gems that meet the version requirement.

Upvotes: 5

grimsock
grimsock

Reputation: 794

I would go with some bash oneliner:

if ! gem list | grep your_gem_name; then gem install your_gem_name; fi;

Upvotes: 0

Related Questions