[Nix-dev] Ruby-gems

Armijn Hemel armijn at uulug.nl
Sun Aug 3 13:32:48 CEST 2008


On Sun, 2008-08-03 at 10:48 +0200, Pjotr Prins wrote:
> On Sun, Aug 03, 2008 at 12:25:13AM +0200, Pjotr Prins wrote:
> > This can not be right! 
> 
> HELP!
> 
> Ruby install gets it wrong - Python appears to do the right thing with
> NIX (though I doubt eggs will work). I am not enough of a NIX guru to
> fix it.
> 
> When you do:
> 
> Install ruby
> Install rubygems (which should really be named ruby-gem)
> gem install rake
> 
> nix-store --verify --check-contents 
> checking path existence
> path `/nix/store/v914ms0apfk2jbkm5kzqp4w35nbkcx1c-ruby-1.8.7-p22' was modified! expected hash `a4b66e33ee2833d2af00932469a3ce394cacdfefce27fdee19ff37500285a61d', got `788c65c808a3582923fb8345f5906996b8abc758adfb6f76ff71d097eaa60c71'
> 
> I presume this is not OK.

No it is not. I'm also wondering how that is possible, since (I think)
we strip the 'w' bit off the store paths.

> I guess this is trickier than the eye meets. You don't want an
> external package manager to modify the store. So these 'gems' can not
> be installed under /nix/store as gems don't use nix-env.
> 
> But you also don't want them on the standard path, like
> /var/lib/gems, as there may be another gem installer running on the
> hosting OS (Debian in, my case). 
> 
> I think the only sensible alternative is a special NIX path for this
> type of effect. E.g. /var/lib/nix/gems and
> /usr/lib/nix/ruby/site-config.
> 
> The *correct* way would be to modify Ruby gems to use NIX for package
> management. But this may be a little hard and does not prevent other
> users to try and mix in the wrong gems.
> 
> Note to all: People are hooked on gems - we can't get them off.
> 
> I need some advise.

In the past we have used wrapper packages for this. It would work a bit
like this (but I don't know how it would impact Ruby things):

1 install a package with Nix
2 install addons
3 create an expression, which takes 1 and 2 as input and creates a
wrapper package, that combines the two packages, using environment
variables, search paths, and so on

I don't know if setting search paths and environment variables and all
is possible with Ruby gems. Is there any easy documentation about it?

armijn

-- 
-------------------------------------------------------------------------
armijn at uulug.nl | http://www.uulug.nl/ | UULug: Utrecht Linux Users Group
-------------------------------------------------------------------------




More information about the nix-dev mailing list