I installed spree by adding it in gemfile. It was giving me errors, so I went to the github site, and installed spree using “gem install spree”. But now it looks like i have two sets of gems for the dependencies of spree:
I can see it being quite dangerous to uninstall all dependancies of a
given gem. In theory it could be dependant on gems which have become
part of the core library in more recent Ruby versions, for example.
However if you mean you want to keep only the latest version of each
gem, there's the "gem clean" command.
Also there are other dangers. Let’s assume an RSS-Feed-Gem wich depends on Nokogiri. Also you have a rails app which depends on Nokogiri.
Now you remove that RSS-Gem and your App suddenly stops working. Ok, that is as easy as bundle command but creates unnecessary traffic and consumes time.
No need, it does not matter if additional ones are installed. The
versions defined in Gemfile and hence Gemfile.lock are the ones that
will be used by the app. If you feel you must remove them however
then [1] describes how to remove a particular version of a gem.
This is an extreme assumption that somehow blindly implies that
dependency resolving does not and probably won't exist if this feature
exists. My refute to that is: apt. Just because you remove one gem
and another relies on a dependency the removed relied on does not mean
you cannot resolve dependencies and figure out if it's still needed by
another gem, as a matter of fact, bundler already has most of that
built into it and on tap, it just needs to be reworked a bit and
presto, you have an apt like resolver.
“gem uninstall” asks you if you really want to uninstall if there are dependencies.
But there are a lot of third-party dependencies that spree needed, and installed. Want to just clean up everything that you don’t use and start over again with your system gemset? Do the same without the spree filter. It’ll uninstall everything that doesn’t have a dependency without asking, and ask you if it does.
Since gem does only look at installed gems and there is no flag like
apts "installed manually" and bundler does only recognize dependencies
on a per project basis, my scenario is valid with the current
architecture.
Since gem does only look at installed gems and there is no flag like
apts “installed manually” and bundler does only recognize dependencies
on a per project basis, my scenario is valid with the current
architecture.