How to install a specific version of a ruby gem?
Use the -v
flag:
$ gem install fog -v 1.8
Use the --version
parameter (shortcut -v
):
$ gem install rails -v 0.14.1
You can also use version comparators like >=
or ~>
$ gem install rails -v '~> 0.14.0'
Or with newer versions of gem even:
$ gem install rails:0.14.4 rubyzip:'< 1'
…
Successfully installed rails-0.14.4
Successfully installed rubyzip-0.9.9
For installing
gem install gemname -v versionnumber
For uninstall
gem uninstall gemname -v versionnumber