uninstall dependencies along with the gem

241 views
Skip to first unread message

John Merlino

unread,
Jun 22, 2013, 7:41:16 PM6/22/13
to rubyonra...@googlegroups.com
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?

Joel Pearson

unread,
Jun 22, 2013, 8:11:23 PM6/22/13
to rubyonra...@googlegroups.com
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.

--
Posted via http://www.ruby-forum.com/.

Norbert Melzer

unread,
Jun 23, 2013, 5:39:10 AM6/23/13
to Rails Mailinglist

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.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ab8c263babbdc8d13999b61da2aae7f0%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.


Colin Law

unread,
Jun 23, 2013, 5:53:57 AM6/23/13
to rubyonra...@googlegroups.com
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

Jordon Bedwell

unread,
Jun 23, 2013, 7:21:37 AM6/23/13
to rubyonra...@googlegroups.com
On Sun, Jun 23, 2013 at 4:39 AM, Norbert Melzer <timm...@gmail.com> 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.

Ivan Histand

unread,
Jun 23, 2013, 9:11:35 AM6/23/13
to rubyonra...@googlegroups.com
On Saturday, June 22, 2013 6:41:16 PM UTC-5, John Merlino 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

Norbert Melzer

unread,
Jun 23, 2013, 11:15:21 AM6/23/13
to rubyonra...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Am Sun, 23 Jun 2013 06:21:37 -0500
schrieb Jordon Bedwell <envy...@gmail.com>:
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-----

Norbert Melzer

unread,
Jun 23, 2013, 3:50:32 PM6/23/13
to Rails Mailinglist

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

Am Sun, 23 Jun 2013 06:21:37 -0500
schrieb Jordon Bedwell <envy...@gmail.com>:

> On Sun, Jun 23, 2013 at 4:39 AM, Norbert Melzer <timm...@gmail.com>

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)

Reply all
Reply to author
Forward
0 new messages