# Upgrading Compiled Version of Ruby

**URL:** <https://www.ruby-forum.com/t/upgrading-compiled-version-of-ruby/93695>\
**Category:** Ruby\
**Created:** [April 6, 2006, 6:38pm UTC](https://www.ruby-forum.com/t/upgrading-compiled-version-of-ruby/93695 "2006-04-06T18:38:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben\_Gribaudo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/6a8cbe/32.png) [@Ben\_Gribaudo](https://www.ruby-forum.com/u/Ben_Gribaudo)\
**Post date:** [April 6, 2006, 6:38pm UTC](https://www.ruby-forum.com/t/upgrading-compiled-version-of-ruby/93695/1 "2006-04-06T18:38:46Z")

</div>

Hello,

In the past, we’ve used Debian’s package management system (apt) to  
handle installing and upgrading Ruby. We’re considering building Ruby  
from source on our next production Web server (an Ubuntu Breezy box).

Let’s say we compile Ruby ourselves. Down the road, when we want to  
upgrade to another Ruby version, we’ll build then run “make install” to  
install the new version. When we do this, how do we make sure that any  
stray files from the previous version get cleaned up?

Do you see what I’m getting at? If the current version of Ruby contains  
a file called something.rb and the newer version does not, how do we  
make sure that something gets deleted when we upgrade?

Thank you,  
Ben

---

<div class="post-metadata">

**Author:** ![Ben\_Gribaudo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/6a8cbe/32.png) [@Ben\_Gribaudo](https://www.ruby-forum.com/u/Ben_Gribaudo)\
**Post date:** [April 6, 2006, 7:09pm UTC](https://www.ruby-forum.com/t/upgrading-compiled-version-of-ruby/93695/2 "2006-04-06T19:09:50Z")

</div>

Well, this rarely happens. Let’s say that something.rb does get  
removed from the ruby distribution between version X and Y. Well, now  
any ruby program written for X that has  
require ‘something’  
is going to break in Y. So Y is no longer backwards compatible with  
X, which is undesirable.

Second, even if it does happen, each major version of ruby has it’s  
own directory in /lib/ruby, i.e., /lib/ruby/1.8,  
/lib/ruby/1.9, etc. So even if a file did get removed the old  
file wouldn’t be in the new directory.

If you’re still concerened, you could always ‘rm -rf  
/lib/ruby/’ before running make install. Or do a  
make install into a new install path and do a directory diff and then  
do a make install into your real install path.

c.

---

<div class="post-metadata">

**Author:** ![Ben\_Gribaudo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/6a8cbe/32.png) [@Ben\_Gribaudo](https://www.ruby-forum.com/u/Ben_Gribaudo)\
**Post date:** [April 6, 2006, 7:57pm UTC](https://www.ruby-forum.com/t/upgrading-compiled-version-of-ruby/93695/3 "2006-04-06T19:57:20Z")

</div>

> Second, even if it does happen, each major version of ruby has it’s  
> own directory in /lib/ruby, i.e., /lib/ruby/1.8,  
> /lib/ruby/1.9, etc. So even if a file did get removed the old  
> file wouldn’t be in the new directory.

This pretty much covers it. I really don’t ever see there being any  
problems. You could try something like [http://www.encap.org/](http://www.encap.org/) to manage  
your from source packages.

Peronally I’ve recently moved to building Ruby from source on Ubuntu and  
have been much happier. I did a very terse howto you can find at  
[http://mgreenly.metaspot.net/?p=37](http://mgreenly.metaspot.net/?p=37) I mostly recorded this so I could  
refer back to it myself the next time I needed to do it 😉

---

<div class="post-metadata">

**Author:** ![Ben\_Gribaudo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/6a8cbe/32.png) [@Ben\_Gribaudo](https://www.ruby-forum.com/u/Ben_Gribaudo)\
**Post date:** [April 7, 2006, 1:10am UTC](https://www.ruby-forum.com/t/upgrading-compiled-version-of-ruby/93695/4 "2006-04-07T01:10:59Z")

</div>

Michael G. wrote:

> You could try something like [http://www.encap.org/](http://www.encap.org/) to manage  
> your from source packages.

Thanks for the link! I’ve had my own system for years, and it’s pretty  
clean, but this is great!

–Steve

---

<div class="post-metadata">

**Author:** ![Ben\_Gribaudo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/6a8cbe/32.png) [@Ben\_Gribaudo](https://www.ruby-forum.com/u/Ben_Gribaudo)\
**Post date:** [April 11, 2006, 5:04pm UTC](https://www.ruby-forum.com/t/upgrading-compiled-version-of-ruby/93695/5 "2006-04-11T17:04:50Z")

</div>

Michael G. wrote:

> Peronally I’ve recently moved to building Ruby from source on Ubuntu and  
> have been much happier. I did a very terse howto you can find at  
> [http://mgreenly.metaspot.net/?p=37](http://mgreenly.metaspot.net/?p=37) I mostly recorded this so I could  
> refer back to it myself the next time I needed to do it 😉

Nice script. Just used it. Thanks.
