[Neurodebian-devel] ruby

Yaroslav Halchenko debian at onerussian.com
Thu Apr 12 23:18:18 UTC 2012


I wish I could give a comprehensive reply but I know next to nothing
about Ruby and the way it is maintained in Debian (besides that there
were ... not so smooth periods in "Ruby in Debian" life [1])

[1] e.g. http://www.lucas-nussbaum.net/blog/?p=566

> The problem: Ubuntu 11.10 uses ruby 1.8. 

but all recent debian and thus ubuntu releases also provide some
ruby1.9.x package which provides API of ruby 1.9.1 (here it is confusing
to me too a bit(; so why don't you just Depends: ruby1.9.1 (there might be
better/correct way -- check what other ruby packages do) and then use versioned
ruby (i.e. ruby1.9.1) instead of a plain ruby?

$> whohas --strict -D Debian,Ubuntu ruby1.9.1 
Ubuntu      ruby1.9.1                              1.9.1.378-1        26K             universe                  http://packages.ubuntu.com/lucid/ruby1.9.1
Ubuntu      ruby1.9.1                              1.9.2.0-1          35K             universe                  http://packages.ubuntu.com/maverick/ruby1.9.1
Ubuntu      ruby1.9.1                              1.9.2.0-2          35K             universe                  http://packages.ubuntu.com/natty/ruby1.9.1
Ubuntu      ruby1.9.1                              1.9.2.290-2        36K             universe                  http://packages.ubuntu.com/oneiric/ruby1.9.1
Ubuntu      ruby1.9.1                              1.9.3.0-1ubuntu1   37K                                       http://packages.ubuntu.com/precise/ruby1.9.1
Debian      ruby1.9.1                              1.9.2.0-2          736K            stable                    http://packages.debian.org/squeeze/ruby1.9.1
Debian      ruby1.9.1                              1.9.3.0-2          185K            testing                   http://packages.debian.org/wheezy/ruby1.9.1
Debian      ruby1.9.1                              1.9.3.0-2          185K            unstable                  http://packages.debian.org/sid/ruby1.9.1


Now:
> The issue is that not only /usr/bin/ruby should refer to a version equal or greater than 1.9, but also ruby-gnome2.

looking into its Debian.changelog:

ruby-gnome2 (1.0.0-1) unstable; urgency=low
....
    - Build for both ruby1.8 and ruby1.9.1 (Closes: #550806)
...

so (I guess) you just need to Depends: ruby-gnome2 (>= 1.0.0-1)

$> whohas -D Debian,Ubuntu ruby-gnome2
Ubuntu      ruby-gnome2                            0.16.0-10          1K              universe                  http://packages.ubuntu.com/hardy/ruby-gnome2
Ubuntu      ruby-gnome2                            0.19.3-1ubuntu3    14K             universe                  http://packages.ubuntu.com/lucid/ruby-gnome2
Ubuntu      ruby-gnome2                            0.19.3-2ubuntu1    10K             universe                  http://packages.ubuntu.com/maverick/ruby-gnome2
Ubuntu      ruby-gnome2                            0.19.3-2ubuntu1    10K             universe                  http://packages.ubuntu.com/natty/ruby-gnome2
Ubuntu      ruby-gnome2                            1.0.0-1            1K              universe                  http://packages.ubuntu.com/oneiric/ruby-gnome2
Ubuntu      ruby-gnome2                            1.0.3-1build1      1K              universe                  http://packages.ubuntu.com/precise/ruby-gnome2
Debian      ruby-gnome2                            0.19.3-2           13K             stable                    http://packages.debian.org/squeeze/ruby-gnome2
Debian      ruby-gnome2                            1.0.3-1            17K             testing                   http://packages.debian.org/wheezy/ruby-gnome2
Debian      ruby-gnome2                            1.0.3-1            17K             unstable                  http://packages.debian.org/sid/ruby-gnome2

so, for Debian stable and ubuntu < oneiric someone might need to look
into backporting this package (if possible),

thus summarizing

> Questions:
> 1) How can I put in the package dependencies (in the "control" file) that ruby1.9 and the related ruby-gnome will be installed?

Depends: ruby1.9.1, ruby-gnome2 (>= 1.0.0-1~)

(~ in above just in case there would come a backport of that specific debian
package)

> 2) How can I ensure that a call to /usr/bin/ruby actually calls /usr/bin/ruby1.9.

I would not although technically it is possible since 

$> sudo update-alternatives --config ruby
There are 2 choices for the alternative ruby (providing /usr/bin/ruby).
 
  Selection    Path                Priority   Status
------------------------------------------------------------
* 0            /usr/bin/ruby1.8     50        auto mode
  1            /usr/bin/ruby1.8     50        manual mode
  2            /usr/bin/ruby1.9.1   10        manual mode

Press enter to keep the current choice[*], or type selection number: 

but because there is no guarantee that all  ruby modules are working with 1.9
you might break functioning of them...

and I would adjust the scripts to call ruby1.9.1 directly. 

> I am not sure how to deal with this, especially systems that have both 1.8 and 1.9 installed. To make things harder, some Debians have 1.9.1 some 1.9.2, for me any 1.9.* is good.

just depend on ruby1.9.1 which should provide you with a needed version

On Thu, 12 Apr 2012, psytoolkit wrote:

> Hi,

> I am working on a PsyToolkit Debian package. PsyToolkit uses ruby. In the next version, it works only with ruby 1.9, which nowadays is the ruby default anyway.

> The problem: Ubuntu 11.10 uses ruby 1.8. I know that the next Ubuntu will have 1.9, but I still would like to make sure that PsyToolkit runs on all (older) debian based Linux versions.

> The issue is that not only /usr/bin/ruby should refer to a version equal or greater than 1.9, but also ruby-gnome2.


> 2) How can I ensure that a call to /usr/bin/ruby actually calls /usr/bin/ruby1.9.

> I am not sure how to deal with this, especially systems that have both 1.8 and 1.9 installed. To make things harder, some Debians have 1.9.1 some 1.9.2, for me any 1.9.* is good.

> Thank you so much for your help.
> PsyToolkit team.



> _______________________________________________
> Neurodebian-devel mailing list
> Neurodebian-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/neurodebian-devel


-- 
=------------------------------------------------------------------=
Keep in touch                                     www.onerussian.com
Yaroslav Halchenko                 www.ohloh.net/accounts/yarikoptic



More information about the Neurodebian-devel mailing list