# How to exclude a gem from "gem update"

**URL:** <https://www.ruby-forum.com/t/how-to-exclude-a-gem-from-gem-update/192105>\
**Category:** Rails\
**Created:** [July 23, 2010, 9:17pm UTC](https://www.ruby-forum.com/t/how-to-exclude-a-gem-from-gem-update/192105 "2010-07-23T21:17:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [July 23, 2010, 9:17pm UTC](https://www.ruby-forum.com/t/how-to-exclude-a-gem-from-gem-update/192105/1 "2010-07-23T21:17:17Z")

</div>

Hi,

Is there a way to tell rubygems to update all gems except some?  
Something to put in ~/.gemrc?

---

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [July 23, 2010, 10:06pm UTC](https://www.ruby-forum.com/t/how-to-exclude-a-gem-from-gem-update/192105/2 "2010-07-23T22:06:10Z")

</div>

Fernando P. wrote:

> Hi,
> 
> Is there a way to tell rubygems to update all gems except some?  
> Something to put in ~/.gemrc?

I’m not sure, but how useful would this be? Updating a gem doesn’t  
remove older versions, so it normally won’t break anything.

Best,  
–Â  
Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

Sent from my iPhone

---

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [July 23, 2010, 11:20pm UTC](https://www.ruby-forum.com/t/how-to-exclude-a-gem-from-gem-update/192105/3 "2010-07-23T23:20:32Z")

</div>

On Jul 23, 8:17 pm, Fernando P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi,
> 
> Is there a way to tell rubygems to update all gems except some?  
> Something to put in ~/.gemrc?

why do you care? If you’ve got some code that doesn’t work with the  
latest version of a gem you can make rubygems always load the exact  
version you need.

Fred

---

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [July 24, 2010, 12:28pm UTC](https://www.ruby-forum.com/t/how-to-exclude-a-gem-from-gem-update/192105/4 "2010-07-24T12:28:12Z")

</div>

Hi guys,

You’re not directly answering my question (I consider the answer as no  
it’s not possible), and since you’re asking “why?”:

I run a FreeBSD server and I wanted to install Nginx with option to  
support passenger and Ruby 1.9 through FreeBSD ports’ system.

The problem is that Nginx requires the ruby-rake to be installed through  
port as well. This means that if I run “gem update”, rake will be  
updated and its corresponding freebsd port will still be thinking to see  
the old version, so when I update my ports, the port manager will be  
confused because it sees a rake binary which is not the expected one  
(freebsd port manager does a checksum on binaries).

Therefore I’d like to be able to update all gems using “gem update”, and  
update the rake gem using freebsd ports.

But if you have any workarounds to offer I’ll gladly consider them 🙂
