[Nix-dev] Rubygems and bundler

Andrew Morsillo andrew.morsillo at gmail.com
Thu Mar 7 15:58:55 CET 2013


Thank you for the links Marc! The challenge posed by packaging systems like
rubygems in nix is more clear to me now.

I definitely still have a lot of learning to do about nix so I will study
your solution closely.

Andrew

On Thu, Mar 7, 2013 at 7:46 AM, Marc Weber <marco-oweber at gmx.de> wrote:

> Excerpts from Andrew Morsillo's message of Thu Mar 07 05:18:24 +0100 2013:
> > I am trying to get an environment set up to run my rails application on
> > nixos but I am confused about how rubygems/bundler is handled. I have
> read
>
> It is not at all.
> http://gitorious.org/nixpkgs-ruby-overlay
>
> Comes closest.
> See http://gitorious.org/nixpkgs-ruby-overlay/nixpkgs-ruby-overlay-specs
>
> bundler is broken by design because it doesn't check versions of
> dependencies level > 2.
> Eg A > B > C  - then version constraints for C will not be checked.
>
> > over rubygems.nix and see that I could install all my dependencies by
> > generating nix expression for them with "gem nix" but trying to do this
> has
> > lead me to two problems:
>
> > 1) "gem nix" does not appear to be able to handle gems that require
> > building native extensions.
> You can pass paths to includes and library directories somehow, but its
> a mess.
>
> => see tarruby, mysql packages etc.
>
> http://gitorious.org/nixpkgs-ruby-overlay/nixpkgs-ruby-overlay/blobs/master/pkgs/defaults.nix
>
> If bundler could output a derivation description as found in
>
> http://gitorious.org/nixpkgs-ruby-overlay/nixpkgs-ruby-overlay/blobs/master/default.nix
> (see rails there to see some examples)
>
> You'd be pretty much done - except that its awkward to get 40.000
> package descriptions if you use only 20 of them.
>
> I'd like to fix this by implementing a http api in nix, so that data can
> be fetched from trusted servers (and then can be cached)
>
> > What is the best way to handle gems with native extensions?
> There is no "perfect way".
>
> > Why can't bundler read the existing gems I have installed into the nix
> > store?
> You don't want a reply to this because you know it: Nobody implemented
> it.
>
> > Are others running complex rails applications on nixos and if so what is
> > your setup?
> Don't think so.
>
> > I can run my application by setting up a custom build environment and
> > installing rvm in my home directory, but I would rather do it the "nixos
> > way" if possible.
> rvm is stateful and a mess (compared to nix). I had in mind making it
> nix compatible. Then I couldn't spend enough time on it.
>
> Marc Weber
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20130307/f55e1bc2/attachment.html 


More information about the nix-dev mailing list