# Determining whether the running ruby is outdated?

**URL:** <https://rubytalk.org/t/determining-whether-the-running-ruby-is-outdated/59567>\
**Category:** ruby-talk\
**Created:** [10 August 2010 09:25 UTC](https://rubytalk.org/t/determining-whether-the-running-ruby-is-outdated/59567 "2010-08-10T09:25:11Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lars\_Olsson1](https://avatars.discourse-cdn.com/v4/letter/l/838e76/32.png) [@Lars\_Olsson1](https://rubytalk.org/u/Lars_Olsson1)\
**Post date:** [10 August 2010 09:25 UTC](https://rubytalk.org/t/determining-whether-the-running-ruby-is-outdated/59567/1 "2010-08-10T09:25:11Z")

</div>

Hi,

I'm writing a small utility that shows information on the currently  
running ruby environment. One part of the utility checks whether any  
gems is outdated, but I also want to check if the ruby interpreter  
itself is outdated. Getting the currently installed version is simple,  
but getting a list of released ruby versions seems a bit trickier. I'm  
mainly interested in \*stable\* source versions, but I don't mind if my  
utility lists development and rc versions as well.

Does anyone know a good way of checking this? My first try was to use  
the ruby github mirror to fetch available tags. Then I tried using  
[svn.ruby-lang.org](http://svn.ruby-lang.org) to get the same information, but neither of those  
gave me the information I wanted in a simple way.

Any suggestions on how to solve this?

/lasso

---

<div class="post-metadata">

**Author:** ![Roger\_Pack4](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@Roger\_Pack4](https://rubytalk.org/u/Roger_Pack4)\
**Post date:** [10 August 2010 19:16 UTC](https://rubytalk.org/t/determining-whether-the-running-ruby-is-outdated/59567/2 "2010-08-10T19:16:50Z")

</div>

Lars Olsson wrote:

> Hi,
> 
> I'm writing a small utility that shows information on the currently  
> running ruby environment. One part of the utility checks whether any  
> gems is outdated, but I also want to check if the ruby interpreter  
> itself is outdated. Getting the currently installed version is simple,  
> but getting a list of released ruby versions seems a bit trickier. I'm  
> mainly interested in \*stable\* source versions, but I don't mind if my  
> utility lists development and rc versions as well.  
> Any suggestions on how to solve this?

Possibly parse this list:

[http://ftp.ruby-lang.org/pub/ruby/1.9/](http://ftp.ruby-lang.org/pub/ruby/1.9/)

et al.  
-r

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Dan\_Rathbun](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@Dan\_Rathbun](https://rubytalk.org/u/Dan_Rathbun)\
**Post date:** [11 August 2010 00:38 UTC](https://rubytalk.org/t/determining-whether-the-running-ruby-is-outdated/59567/3 "2010-08-11T00:38:12Z")

</div>

Lars Olsson wrote:

> I'm writing a small utility that shows information on the currently  
> running ruby environment. One part of the utility checks whether any  
> gems is outdated, but I also want to check if the ruby interpreter  
> ... Getting the currently installed version is simple,  
> but getting a list of released ruby versions seems a bit trickier. I'm  
> mainly interested in \*stable\* source versions, but I don't mind if my  
> utility lists development and rc versions as well.

I just went thru ALL the 1.8.x i386-mswin32 releases compiling a list,  
and did 1.9.1 also.

I did NOT do any previews, or release candidates, or 1.9.0 or 1.6.x

> Any suggestions on how to solve this?

I had to spend 2 days downloading every package, extracting the  
interpreter DLLs, a PITB.

The file is not done.. I'm missing a few dates.  
I may also be missing a few patch\_levels that were released for test,  
but no precompiled package was released. (not likely anyone is running  
them.)

I wrote a PureRuby Backport Patch for older versions, that adds newer  
constants to older versions (\<1.8.7), which you might like to use  
(you'll get the idea when you read it; it can be condensed into smaller  
code.)  
It's attached here, and in the post you'll see other links where it's  
available (rubyforge snippet library, etc.)  
[http://redmine.ruby-lang.org/issues/show/3665](http://redmine.ruby-lang.org/issues/show/3665)

.. some has suggested I add RUBY\_ENGINE to all before 1.9.x (but I  
haven't got to it yet.)

Attachments:  
[http://www.ruby-forum.com/attachment/4934/Ruby\_Releases.txt](http://www.ruby-forum.com/attachment/4934/Ruby_Releases.txt)

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Florian\_Assmann2](https://avatars.discourse-cdn.com/v4/letter/f/41988e/32.png) [@Florian\_Assmann2](https://rubytalk.org/u/Florian_Assmann2)\
**Post date:** [11 August 2010 19:33 UTC](https://rubytalk.org/t/determining-whether-the-running-ruby-is-outdated/59567/4 "2010-08-11T19:33:31Z")

</div>

I did in IRB

`svn ls [http://svn.ruby-lang.org/repos/ruby/tags`.split.grep(/\Av\d/)](http://svn.ruby-lang.org/repos/ruby/tags%60.split.grep(/%5CAv%5Cd/))  
&nbsp;&nbsp;&nbsp;&nbsp;.map { |d| `svn cat [http://svn.ruby-lang.org/repos/ruby/tags/#{d}version.h\`](http://svn.ruby-lang.org/repos/ruby/tags/#%7Bd%7Dversion.h%5C%60) }

It took a while but I had alot of information.

> **···**
>
> Am 10.08.2010 um 11:25 schrieb Lars Olsson:
> 
> > Hi,
> > 
> > I'm writing a small utility that shows information on the currently  
> > running ruby environment. One part of the utility checks whether any  
> > gems is outdated, but I also want to check if the ruby interpreter  
> > itself is outdated. Getting the currently installed version is simple,  
> > but getting a list of released ruby versions seems a bit trickier. I'm  
> > mainly interested in \*stable\* source versions, but I don't mind if my  
> > utility lists development and rc versions as well.
> > 
> > Does anyone know a good way of checking this? My first try was to use  
> > the ruby github mirror to fetch available tags. Then I tried using  
> > svn.ruby-lang.org to get the same information, but neither of those  
> > gave me the information I wanted in a simple way.
> > 
> > Any suggestions on how to solve this?
> > 
> > /lasso

---

<div class="post-metadata">

**Author:** ![Dan\_Rathbun](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@Dan\_Rathbun](https://rubytalk.org/u/Dan_Rathbun)\
**Post date:** [11 August 2010 00:42 UTC](https://rubytalk.org/t/determining-whether-the-running-ruby-is-outdated/59567/5 "2010-08-11T00:42:06Z")

</div>

Dan Rathbun wrote:

> .. some has suggested I add RUBY\_ENGINE to all before 1.9.x (but I  
> haven't got to it yet.)

Here's the snippet for RUBY\_ENGINE:

> **···**
>
> #  
> &nbsp;&nbsp;# RUBY\_ENGINE was added sometime in the 1.9.x branch  
> &nbsp;&nbsp;#  
> &nbsp;&nbsp;if defined?(RUBY\_ENGINE).nil?  
> &nbsp;&nbsp;&nbsp;&nbsp;RUBY\_ENGINE = RUBY\_VERSION.split('.')[0..1].join('.')  
> &nbsp;&nbsp;end
> 
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Lars\_Olsson1](https://avatars.discourse-cdn.com/v4/letter/l/838e76/32.png) [@Lars\_Olsson1](https://rubytalk.org/u/Lars_Olsson1)\
**Post date:** [11 August 2010 10:20 UTC](https://rubytalk.org/t/determining-whether-the-running-ruby-is-outdated/59567/6 "2010-08-11T10:20:07Z")

</div>

Thanks guys! I was hoping there was a simpler method than parsing  
directory listings (say, like a text file) but if that's the way to go  
then I'll just have to dig in.

/lasso

> **···**
>
> On 10 Aug, 21:16, Roger Pack \<rogerpack2...@gmail.com\> wrote:
> 
> > Lars Olsson wrote:  
> > \> Hi,
> > 
> > \> I'm writing a small utility that shows information on the currently  
> > \> running ruby environment. One part of the utility checks whether any  
> > \> gems is outdated, but I also want to check if the ruby interpreter  
> > \> itself is outdated. Getting the currently installed version is simple,  
> > \> but getting a list of released ruby versions seems a bit trickier. I'm  
> > \> mainly interested in \*stable\* source versions, but I don't mind if my  
> > \> utility lists development and rc versions as well.  
> > \> Any suggestions on how to solve this?
> > 
> > Possibly parse this list:
> > 
> > [pub/ruby/1.9/](http://ftp.ruby-lang.org/pub/ruby/1.9/)
> > 
> > et al.  
> > -r  
> > --  
> > Posted viahttp://www.ruby-forum.com/.

---

<div class="post-metadata">

**Author:** ![Roger\_Pack4](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@Roger\_Pack4](https://rubytalk.org/u/Roger_Pack4)\
**Post date:** [11 August 2010 11:27 UTC](https://rubytalk.org/t/determining-whether-the-running-ruby-is-outdated/59567/7 "2010-08-11T11:27:25Z")

</div>

> I wrote a PureRuby Backport Patch for older versions, that adds newer  
> constants to older versions (\<1.8.7), which you might like to use  
> (you'll get the idea when you read it; it can be condensed into smaller  
> code.)  
> It's attached here, and in the post you'll see other links where it's  
> available (rubyforge snippet library, etc.)  
> [http://redmine.ruby-lang.org/issues/show/3665](http://redmine.ruby-lang.org/issues/show/3665)

There's also a backports gem, if that helps at all.

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Roger\_Pack4](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@Roger\_Pack4](https://rubytalk.org/u/Roger_Pack4)\
**Post date:** [11 August 2010 11:26 UTC](https://rubytalk.org/t/determining-whether-the-running-ruby-is-outdated/59567/8 "2010-08-11T11:26:55Z")

</div>

> Thanks guys! I was hoping there was a simpler method than parsing  
> directory listings (say, like a text file) but if that's the way to go  
> then I'll just have to dig in.

Yeah that's the general way people have done it in the past. You could  
also screen scrape ruby-lang.org page I suppose...

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Dan\_Rathbun](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@Dan\_Rathbun](https://rubytalk.org/u/Dan_Rathbun)\
**Post date:** [11 August 2010 12:48 UTC](https://rubytalk.org/t/determining-whether-the-running-ruby-is-outdated/59567/9 "2010-08-11T12:48:14Z")

</div>

Lars Olsson wrote:

> > \> Any suggestions on how to solve this?
> 
> Thanks guys! I was hoping there was a simpler method than parsing  
> directory listings (say, like a text file) ...

I attached my TEXT FILE to my previous post Lars.

Look at the header, viz:

Re: Determining whether the running ruby is outdated?  
Posted by Dan Rathbun (dan\_rathbun) on 11.08.2010 02:38  
Attachment: Ruby\_Releases.txt (1,1 KB) \<\<\<---------------\<\<\<\<\<\<

... or click this link:  
[http://www.ruby-forum.com/attachment/4934/Ruby\_Releases.txt](http://www.ruby-forum.com/attachment/4934/Ruby_Releases.txt)

... BUT be aware I have seen the release date vary in the minGW32 built  
DLLs by a few days, from the "official" release date. I am not sure if  
that also is reflected in the value of the RUBY\_RELEASE\_DATE constant  
when running a minGW32 built interpreter.

You could ask Luis Lavena over at:  
[http://groups.google.com/group/rubyinstaller](http://groups.google.com/group/rubyinstaller)  
.

> **···**
>
> > On 10 Aug, 21:16, Roger Pack \<rogerpack2...@gmail.com\> wrote:
> 
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Lars\_Olsson1](https://avatars.discourse-cdn.com/v4/letter/l/838e76/32.png) [@Lars\_Olsson1](https://rubytalk.org/u/Lars_Olsson1)\
**Post date:** [11 August 2010 16:45 UTC](https://rubytalk.org/t/determining-whether-the-running-ruby-is-outdated/59567/10 "2010-08-11T16:45:08Z")

</div>

Sorry, I did not mean to ignore your solution. Will the file be  
updated on regular intervals? Is the current location static or will  
it change? Since my utility will have to rely on external resources it  
is important to me that it will not break due to those external  
resources changing location or containing old information.

/lasso

> **···**
>
> On 11 Aug, 14:48, Dan Rathbun \<danzoi...@gmail.com\> wrote:
> 
> > Lars Olsson wrote:  
> > \> On 10 Aug, 21:16, Roger Pack \<rogerpack2...@gmail.com\> wrote:  
> > \>\> \> Any suggestions on how to solve this?
> > 
> > \> Thanks guys! I was hoping there was a simpler method than parsing  
> > \> directory listings (say, like a text file) ...
> > 
> > I attached my TEXT FILE to my previous post Lars.
> > 
> > Look at the header, viz:
> > 
> > Re: Determining whether the running ruby is outdated?  
> > Posted by Dan Rathbun (dan\_rathbun) on 11.08.2010 02:38  
> > Attachment: Ruby\_Releases.txt (1,1 KB) \<\<\<---------------\<\<\<\<\<\<
> > 
> > .. or click this link:[http://www.ruby-forum.com/attachment/4934/Ruby\_Releases.txt](http://www.ruby-forum.com/attachment/4934/Ruby_Releases.txt)
> > 
> > .. BUT be aware I have seen the release date vary in the minGW32 built  
> > DLLs by a few days, from the "official" release date. I am not sure if  
> > that also is reflected in the value of the RUBY\_RELEASE\_DATE constant  
> > when running a minGW32 built interpreter.
> > 
> > You could ask Luis Lavena over at:[http://groups.google.com/group/rubyinstaller](http://groups.google.com/group/rubyinstaller)

---

<div class="post-metadata">

**Author:** ![Dan\_Rathbun](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@Dan\_Rathbun](https://rubytalk.org/u/Dan_Rathbun)\
**Post date:** [11 August 2010 17:33 UTC](https://rubytalk.org/t/determining-whether-the-running-ruby-is-outdated/59567/11 "2010-08-11T17:33:22Z")

</div>

Lars Olsson wrote:

> Will the file be updated on regular intervals?

I will update it for my own use (as a reference to keep track  
of what I have done etc., for my own applet.)

> Is the current location static or will it change?

I dont know much about how the ruby-forum software works.

> Since my utility will have to rely on external resources it  
> is important to me that it will not break due to those external  
> resources changing location or containing old information.

Hmmm... Luis Lavena is also involved with pik developement (which is a  
Ruby Version Manager and Configurator,) for Windows. There is also RVM  
(for Unix-like systems.)

Both of these utilities have a gem-like install capability. You would  
think somewhere that there must be a "dictionary" so that these  
utilities can find the 'rubies' (the term for a specific Ruby  
cpu-platform-version-patchlevel package,) to install.

They may just be using RubyGems to read the ruby-lang.org gem  
repository.

But anyway... I am not "on" the Ruby Core project team, the Ruby  
Installer project team, etc. I just make a few suggestions from time to  
time.

I have nothing against anyone taking what I've begun (cleaning it up,  
changing format [JSON, CSV, PStore, etc.] and using it to create on  
online 'official dictionary' of some kind.  
I agree it should be somewhere like rubyforge.net or ruby-lang.org

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Dan\_Rathbun](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@Dan\_Rathbun](https://rubytalk.org/u/Dan_Rathbun)\
**Post date:** [11 August 2010 19:29 UTC](https://rubytalk.org/t/determining-whether-the-running-ruby-is-outdated/59567/12 "2010-08-11T19:29:12Z")

</div>

Lars, I found where the information is in each package.

It is in the version.h file (a C source header file.)

In the some of the older precompiled packages, a copy of this file, is  
placed in the #{platform} subdir of the ruby/lib/ruby/#{engine}  
directory.  
In newer precompiled packages, it cannot find it and it may have been  
replaced with rbconfig.rb

In the source packages, the file is in the source/#{ver-patchlevel} dir  
of the source archives.  
The problem with them is thay are all in compressed archives (tarballs  
or zips,) so you cannot read them over the net.

Here's an example of what the version.h file looks like in the 1.8.7  
branch.  
[http://svn.ruby-lang.org/repos/ruby/branches/ruby\_1\_8\_7/version.h](http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_7/version.h)  
This example is only the latest patch as this is the svn active  
development repository. (The file will change at the next revision.)

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Luis\_Lavena1](https://avatars.discourse-cdn.com/v4/letter/l/f08c70/32.png) [@Luis\_Lavena1](https://rubytalk.org/u/Luis_Lavena1)\
**Post date:** [11 August 2010 19:40 UTC](https://rubytalk.org/t/determining-whether-the-running-ruby-is-outdated/59567/13 "2010-08-11T19:40:06Z")

</div>

> Lars, I found where the information is in each package.
> 
> It is in the version.h file (a C source header file.)
> 
> In the some of the older precompiled packages, a copy of this file, is  
> placed in the #{platform} subdir of the ruby/lib/ruby/#{engine}  
> directory.  
> In newer precompiled packages, it cannot find it and it may have been  
> replaced with rbconfig.rb

No, all versions of MRI (Matz Ruby Implementation) still stores  
version information in a C header, not Ruby code.

> In the source packages, the file is in the source/#{ver-patchlevel} dir  
> of the source archives.  
> The problem with them is thay are all in compressed archives (tarballs  
> or zips,) so you cannot read them over the net.

Yes, the only workaround is download, extract and find the file.

In RubyInstaller we know what we are looking for:

> <https://github.com/oneclick/rubyinstaller/blob/master/recipes/packager/inno.rake#L3-14>

> <https://github.com/oneclick/rubyinstaller/blob/master/recipes/packager/inno.rake#L116>

Do a Dir.glob and look for version.h

> **···**
>
> On Aug 11, 4:29 pm, Dan Rathbun \<danzoi...@gmail.com\> wrote:
> 
> --  
> Luis Lavena

---

<div class="post-metadata">

**Author:** ![Lars\_Olsson1](https://avatars.discourse-cdn.com/v4/letter/l/838e76/32.png) [@Lars\_Olsson1](https://rubytalk.org/u/Lars_Olsson1)\
**Post date:** [16 August 2010 17:20 UTC](https://rubytalk.org/t/determining-whether-the-running-ruby-is-outdated/59567/14 "2010-08-16T17:20:16Z")

</div>

Thanks everybody for all of your suggestions. I finally decided that  
the downloads available from ftp.ruby-lang.org provide me with the  
information I need. Even though the information obtained cannot be  
guaranteed to be accurate, the naming scheme on that site seems quite  
stable.

If someone is interested the app is available on github:  
[http://github.com/lasso/random/raw/master/runtimeinfo.rb](http://github.com/lasso/random/raw/master/runtimeinfo.rb)

And here are the results from my current irb session:

irb(main):001:0\> load 'runtimeinfo.rb'  
=\> true  
irb(main):002:0\> puts  
Lassoweb::Utils::RuntimeInfo.latest\_ruby\_versions  
Latest stable version: 1.9.1-p430  
Latest release candidate: 1.9.2-rc2  
Latest preview: 1.9.2-preview3  
=\> nil

/lasso

> **···**
>
> On 11 Aug, 21:35, Luis Lavena \<luislav...@gmail.com\> wrote:
> 
> > On Aug 11, 4:29 pm, Dan Rathbun \<danzoi...@gmail.com\> wrote:
> > 
> > \> Lars, I found where the information is in each package.
> > 
> > \> It is in the version.h file (a C source header file.)
> > 
> > \> In the some of the older precompiled packages, a copy of this file, is  
> > \> placed in the #{platform} subdir of the ruby/lib/ruby/#{engine}  
> > \> directory.  
> > \> In newer precompiled packages, it cannot find it and it may have been  
> > \> replaced with rbconfig.rb
> > 
> > No, all versions of MRI (Matz Ruby Implementation) still stores  
> > version information in a C header, not Ruby code.
> > 
> > \> In the source packages, the file is in the source/#{ver-patchlevel} dir  
> > \> of the source archives.  
> > \> The problem with them is thay are all in compressed archives (tarballs  
> > \> or zips,) so you cannot read them over the net.
> > 
> > Yes, the only workaround is download, extract and find the file.
> > 
> > In RubyInstaller we know what we are looking for:
> > 
> > [http://github.com/oneclick/rubyinstaller/blob/master/recipes/packager...http://github.com/oneclick/rubyinstaller/blob/master/recipes/packager\.\.\](http://github.com/oneclick/rubyinstaller/blob/master/recipes/packager...http://github.com/oneclick/rubyinstaller/blob/master/recipes/packager%5C.%5C.%5C).
> > 
> > Do a Dir.glob and look for version.h
> > 
> > --  
> > Luis Lavena
