Uninstall dependencies along with the gem

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:

spree_api (2.0.3, 0.40.0)
spree_auth (0.40.0)
spree_backend (2.0.3)
spree_cmd (2.0.3)
spree_core (2.0.3, 0.40.0)
spree_dash (0.40.0)
spree_frontend (2.0.3)
spree_promo (0.40.0)
spree_sample (2.0.3, 0.40.0)

How do I uninstall spree and all of the gems that were installed along
with
it?

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.
Am 23.06.2013 02:11 schrieb “Joel P.” [email protected]:

On Sun, Jun 23, 2013 at 4:39 AM, Norbert M. [email protected]
wrote:

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.

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.

On Saturday, June 22, 2013 6:41:16 PM UTC-5, John M. wrote:

How do I uninstall spree and all of the gems that were installed along
with it?

Assuming you’re working in bash:

for gem in $(gem list spree --no-versions); do
echo “working on $gem”
gem uninstall $gem
done

“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.

for gem in $(gem list --no-versions); do
echo “working on $gem”
gem uninstall $gem
done

–Ivan

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Am Sun, 23 Jun 2013 06:21:37 -0500
schrieb Jordon B. [email protected]:

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.

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.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iF4EAREIAAYFAlHHEQkACgkQmStwlOckyZmstQEAxm1qcc6q8cvVNk24PYSshP/H
Kldau4Fa03686wTVXecBALTr5zV45Qgkkxs3JytUOea/Cd0/orIG1OFq4EsbWJCc
=f0Rn
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Am Sun, 23 Jun 2013 06:21:37 -0500
schrieb Jordon B. [email protected]:

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.

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.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iF4EAREIAAYFAlHHEQkACgkQmStwlOckyZmstQEAxm1qcc6q8cvVNk24PYSshP/H
Kldau4Fa03686wTVXecBALTr5zV45Qgkkxs3JytUOea/Cd0/orIG1OFq4EsbWJCc
=f0Rn
-----END PGP SIGNATURE-----

On 23 June 2013 00:41, John M. [email protected] wrote:

spree_frontend (2.0.3)
spree_promo (0.40.0)
spree_sample (2.0.3, 0.40.0)

How do I uninstall spree and all of the gems that were installed along with
it?

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.

[1] http://docs.rubygems.org/read/chapter/10#page38

Colin