Uninstalling gems massively - ruby

I'm using ruby 2.2 and I would like to know is there is a way to uninstall all gems in my gemlist in one command. Something like gem uninstall * or gem uninstall -A ?

gem uninstall --all
Uninstalls every gem in your gem list.

Related

How to revert back changes in gems

So I was debugging locally installed gems:
/Users/myUser/.rvm/gems/ruby-1.9.3-p484#12wbt-engine/gems/locomotive_liquid-2.4.2
And now I removed the this folder. Hence I'm wondering if there is any way to restore it?
DOESN'T WORK:
bundle install
bundle update
What you need is gem pristine
e.g:
gem pristine locomotive_liquid
Try:
gem uninstall locomotive_liquid
bundle install

bundler not found but gem list shows bundler

i use rvm and it works great.
When i type gem list it shows bundler 1.1.5 but which bundler print out: bundler not found.
I did install bundler several times but it doesn't help.
Any suggestions?
Command for bundler gem is not bundler but bundle. So just type bundle on your shell and it will works :)
I could solve this problem with:
rvm gemset use global && gem install bundler
Apparently there was a problem with the gemset. After using global gemset it works like a charm.

How to install multiple ruby gems at once?

Is is possible to install more than one gem at the same time with only one command?
The gem install command accepts many parameters, so you can gem install nokogiri bundler in one shot, for instance.
As others said, Bundler and RVM makes everything connected to managing gems, versions and dependencies a real pleasure.
You can put them in a Gemfile and use bundler (bundle install).
Alternatively, you could list the commands in a file:
gem install pg
gem install sqlite3
and use something like cat <filename> | xargs sudo to execute them.
**Consider using RVM to manage your gems into gemsets rather than installing them globally with sudo.
You can using bundler: http://gembundler.com/

Updating gems on my mac - two versions of bundler installed

I had tons of gems on my local machine which I were installed before and after RVM, so I decided to wipe them all and reinstall. Everything seemed to go ok, except bundler:
gem list
.....
bundler (1.1.3, 1.0.22)
I don't know why 1.0.22 is still there, and I can't figure out how to get rid of it!
$ gem cleanup
Cleaning up installed gems...
Attempting to uninstall bundler-1.0.22
Unable to uninstall bundler-1.0.22:
Gem::InstallError: gem "bundler" is not installed
Clean Up Complete
$ gem uninstall bundler-1.0.22
INFO: gem "bundler-1.0.22" is not installed
UPDATE 1
Path info as requested by Andrew
/Users/brandon/.rvm/gems/ruby-1.9.3-p125-perf#global/gems/bundler-1.0.22/
What's most likely happening is that the two versions of Bundler are installed in two different gemsets, one of which is inheriting from the other. 1.0.22 is probably installed in the global gemset (rvm use #global), or "root" gemset (rvm use <ruby_version>). Once you're in the gemset that has 1.0.22 installed, you should be able to remove it with gem uninstall bundler.

How would I install this locally? Will gem install work?

https://github.com/Shopify/shopify_api
I've never manually installed something like this before, I have only used gem install xxxx in the past.
I am using RVM.
Update
OK, gem install does work, but how would I install it manually?
It's a gem so you could download it and decompress it, cd into its directory, then run rake. But why? gem install will be less work and will do as well.
gem install path/to/gem/file.gem
It's a gem, it's available from Rubygems, so
gem install shopify_api
See https://rubygems.org/gems/shopify_api

Resources