Haris Krajina
Haris Krajina

Reputation: 15276

How to "re-install" a gem?

Question is pretty simple so instead of writting two commands is there one substitute? e.g.

gem uninstall subexec

gem install subexec

Is there just re-install, or something similar?

Upvotes: 3

Views: 423

Answers (5)

Usman
Usman

Reputation: 2345

gem update <gem-name>

would update to latest available version. or

gem update

would update all gems to latest versions.

Upvotes: 0

Itay k
Itay k

Reputation: 4469

If you use bundler for gem installations then all you need to do is edit the gemfile and then run bundle install.

Upvotes: 0

d11wtq
d11wtq

Reputation: 35298

Depending on what you're trying to achieve, the following restores the gem to the contents of the .gem file:

gem pristine <gem name here>

You can also run that with --all if you want to clean your entire set of installed gems.

Upvotes: 4

Stefan H
Stefan H

Reputation: 6683

Nope, you have to do an uninstall and install.

http://docs.rubygems.org/read/book/2

Upvotes: 0

Sergio Tulentsev
Sergio Tulentsev

Reputation: 230296

No, there's no such command. You can, however, fit them on one line, if that's what you seek.

gem uninstall subexec && gem install subexec

Upvotes: 1

Related Questions