Ruby on Rails - Divorce Gems from yum

It is June 28, 2011 -- I have just finished updating my rails host from fedora 14 to 15. I just got bitten by an automatic update of a rails gem being done by the fedora yum package manager and am motivated by this to try to disconnect my rails setup and my yum packages. Here we go.

I decided that having a hybrid yum and gem managed rubygems setup was a bad plan. To this end, I decided to get rid of my yum installed rails setup and install a clean rails using gem only. I do have one non-rails ruby-gtk2 application that I want to keep running, so I will let yum manage the dependencies for ruby-gtk2, which may lead to mischief, we shall see.

yum list | grep rubygem >rubygem.list
This lists 375 packages. After this, I did the drastic measure of:
yum erase rubygems
This took away all 61 installed packages, including rails, activerecord, sqlite3, and even ruby-gtk2!

yum install rubygems brings in only that one package!
yum install ruby-gtk2 brings in several gems:

Installing:
 ruby-gtk2                                       x86_64                            0.90.9-1.fc15
 ruby-atk                                        x86_64                            0.90.9-1.fc15
 ruby-cairo                                      x86_64                            1.10.0-4.fc15
 ruby-gdk_pixbuf2                                x86_64                            0.90.9-1.fc15
 ruby-gettext-package                            noarch                            2.1.0-3.fc15
 ruby-glib2                                      x86_64                            0.90.9-1.fc15
 ruby-locale                                     noarch                            2.0.5-2.fc15.1
 ruby-pango                                      x86_64                            0.90.9-1.fc15
 rubygem-atk                                     x86_64                            0.90.9-1.fc15
 rubygem-cairo                                   x86_64                            1.10.0-4.fc15
 rubygem-gdk_pixbuf2                             x86_64                            0.90.9-1.fc15
 rubygem-gettext                                 noarch                            2.1.0-3.fc15
 rubygem-glib2                                   x86_64                            0.90.9-1.fc15
 rubygem-gtk2                                    x86_64                            0.90.9-1.fc15
 rubygem-locale                                  noarch                            2.0.5-2.fc15.1
 rubygem-pango                                   x86_64                            0.90.9-1.fc15

After this, I did "gem update", which did quite a lot.

Then I did "gem update --system", which moved me from rubygems 1.7.2 to 1.8.5 (now I should figure out how to get yum to leave this alone!!). The best way (maybe) to do this is:
Edit /etc/yum.conf and add the line (at the top, or probably anywhere):

exclude=rubygems
This should allow any specific gems to get updated, but not the rubygems package itself.
Now on to the big one:
gem install rails
This pulls in 25 gems including rails 3.0.9 Then I add some by hand:
gem install json
gem install will_paginate
gem install mysql2
gem install sqlite3
And not to forget, this all important gem:
gem install passenger
service restart httpd
After doing this, I go to each of my rails applications and type
bundle update
And my applications are back on the air.
Feedback? Questions? Drop me a line!

Ruby on Rails notes / [email protected]