Ruby on Rails - Versions

Now that I have been using rails for several years, (It is June, 2008 as I write this) it occurs to me to ask, "What version of rails am I running". I installed rails using the rubygem system back in 2006 or so (and it seems that I am running version 1.2.3, which in 2008 is a bit "crusty" at best). It also occured to me to ask if rails has in some way crept into the yum/rpm world. I boldly did the following, as soon as I discovered that a drastically newer version of rails was available via yum. Next step will be to sort out what conflict and chaos there may be between the gem stuff and this.

[root@cholla log]# yum list | grep rails
rubygem-rails.noarch                     2.0.2-2.fc8            updates         
[root@cholla log]# yum install rubygem-rails
Loading "downloadonly" plugin
Excluding Packages in global exclude list
Finished
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package rubygem-rails.noarch 0:2.0.2-2.fc8 set to be updated
--> Processing Dependency: rubygem(activeresource) = 2.0.2 for package: rubygem-rails
--> Processing Dependency: rubygem(activerecord) = 2.0.2 for package: rubygem-rails
--> Processing Dependency: rubygem(actionpack) = 2.0.2 for package: rubygem-rails
--> Processing Dependency: rubygem(activesupport) = 2.0.2 for package: rubygem-rails
--> Processing Dependency: rubygem(rake) >= 0.7.2 for package: rubygem-rails
--> Processing Dependency: rubygem(actionmailer) = 2.0.2 for package: rubygem-rails
--> Running transaction check
---> Package rubygem-actionpack.noarch 0:2.0.2-2.fc8 set to be updated
---> Package rubygem-actionmailer.noarch 0:2.0.2-2.fc8 set to be updated
---> Package rubygem-activeresource.noarch 0:2.0.2-2.fc8 set to be updated
---> Package rubygem-activesupport.noarch 0:2.0.2-1.fc8 set to be updated
---> Package rubygem-rake.noarch 0:0.8.1-2.fc8 set to be updated
---> Package rubygem-activerecord.noarch 0:2.0.2-2.fc8 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size 
=============================================================================
Installing:
  rubygem-rails           noarch     2.0.2-2.fc8      updates           382 k
Installing for dependencies:
  rubygem-actionmailer    noarch     2.0.2-2.fc8      updates           507 k
  rubygem-actionpack      noarch     2.0.2-2.fc8      updates           2.0 M
  rubygem-activerecord    noarch     2.0.2-2.fc8      updates           1.3 M
  rubygem-activeresource  noarch     2.0.2-2.fc8      updates           148 k
  rubygem-activesupport   noarch     2.0.2-1.fc8      updates           790 k
  rubygem-rake            noarch     0.8.1-2.fc8      updates-released  336 k

Transaction Summary
=============================================================================
Install      7 Package(s)         
Update       0 Package(s)         
Remove       0 Package(s)         

Total download size: 5.4 M
Is this ok [y/N]: y
Downloading Packages:
(1/7): rubygem-activereco 100% |=========================| 1.3 MB    00:00     
(2/7): rubygem-rake-0.8.1 100% |=========================| 336 kB    00:00     
(3/7): rubygem-activesupp 100% |=========================| 790 kB    00:00     
(4/7): rubygem-activereso 100% |=========================| 148 kB    00:00     
(5/7): rubygem-actionmail 100% |=========================| 507 kB    00:00     
(6/7): rubygem-actionpack 100% |=========================| 2.0 MB    00:00     
(7/7): rubygem-rails-2.0. 100% |=========================| 382 kB    00:00     
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing: rubygem-activesupport        ######################### [1/7] 
  Installing: rubygem-actionpack           ######################### [2/7] 
  Installing: rubygem-actionmailer         ######################### [3/7] 
  Installing: rubygem-activeresource       ######################### [4/7] 
  Installing: rubygem-activerecord         ######################### [5/7] 
  Installing: rubygem-rake                 ######################### [6/7] 
  Installing: rubygem-rails                ######################### [7/7] 

Installed: rubygem-rails.noarch 0:2.0.2-2.fc8
Dependency Installed: rubygem-actionmailer.noarch 0:2.0.2-2.fc8 rubygem-actionpack.noarch 0:2.0.2-2.fc8 rubygem-activerecord.noarch 0:2.0.2-2.fc8 rubygem-activeresource.noarch 0:2.0.2-2.fc8 rubygem-activesupport.noarch 0:2.0.2-1.fc8 rubygem-rake.noarch 0:0.8.1-2.fc8
Complete!
Now I may have made quite a mess, we shall see, but ultimately this will be a good thing, since yum will keep my rails system up to date (for better or worse, I expect better).

All this gems stuff (whether from yum or whatever) goes into cd /usr/lib/ruby/gems/1.8/gems, and I see all 4 versions of rails that I have ever used side by side (along with all the supporting versions of activerecord and so forth):

cd /usr/lib/ruby/gems/1.8/gems
ls -ld rails*
drwxr-xr-x 11 root root 4096 Jul 20  2006 rails-1.1.4
drwxr-xr-x 11 root root 4096 Nov 16  2006 rails-1.1.6
drwxr-xr-x 11 root root 4096 Aug 16  2007 rails-1.2.3
drwxr-xr-x 11 root root 4096 Jun 11 11:33 rails-2.0.2
Something new has popped up too: activeresource-2.0.2. A quick look into this seems to indicate that this is a web services and distributed computing kind of thing. The buzzwords for this are: "Representational State Transfer (REST) architectural style for distributed hypermedia systems", which certainly sounds impressive, whatever it all means.

Just to see what dependencies there may be on the old stuff, I create a directory OLD and move all the old versions into there, then try my rails applications -- and they all still work, so far so good.

I type rails -v and get 2.0.2, which is reassuring. I am concerned that my existing rails projects are based on the older version of rails, and I hear about some variable RAILS_GEM_VERSION that either needs to be fiddled by hand, or eliminated to always use the latest version. This can be found in config/environment.rb, and I just comment it out (it was set to 1.2.3 in both projects). Both applications still seem to work, perhaps I would get newer and better scaffolds if I would have generated them under 2.0.2, who knows.


Feedback? Questions? Drop me a line!

Ruby on Rails notes / [email protected]