[Nix-dev] Ruby Development on Nix

Taeer Bar-Yam tb442 at cornell.edu
Fri Jul 15 21:41:35 CEST 2016


Dear Knowledgable Nixers,

Introduction
I have been trying to get ruby gems installed in any way on my nixos machine. I have been reading up on the wikis, and I understand that this is not yet well put together. However, it seems that even things that aught to be working are not.

Problem
I put "bundler" in my configuration.nix, and it installs fine. However, when I try to actually run it, I get the error message:
/nix/store/n5gqlhs1nmadxkbibv42wnxq3m7f404k-ruby-2.3.0-p0/lib/ruby/2.3.0/rubygems.rb:241:in `bin_path': can't find gem bundler (>= 0) (Gem::GemNotFoundException)
        from /run/current-system/sw/bin/bundler:14:in `<main>'

I tried to add the gem I wanted to my configuration.nix directly using buildRubyGem, but ruby was not able to find it.

The method the manual prescribes is dependent on already having bundler installed, so I have not had a chance to test that. 

Request/Solution
I am interested in contributing to the nix community by developing a better system for ruby gem installation, so I guess what I am looking for is the following:

1) For now, what is the current simplest way to install a ruby gem so that I can, in the terminal, type
$ irb
> require 'desired_gem'
and it will work?
This can include simply installing bundler and using that locally with a gemfile, but I would prefer that any system-wide installation be done through configuration.nix

2) If I'm going to add a system for installing ruby gems, what would be the right way to design it? I understand that programming languages sometimes have structure that prevents us from always using the ideal path, so can y'all point me to a programming language that is considered "done right"?

For instance, the python model of
  python27Packages.package1
  python27Packages.package2

is very different from the haskell model of
  (haskellPackages.ghcWithPackages (h: with h; [
    package1
    package2
  ])
My understanding is that the haskell model is a less-than-ideal kludge because haskell wont allow the python method. Is that right? Is there an even better way than python?

Lastly, is there anyone already working on this that I should get in touch with instead of splitting efforts?

Thank you,
  --Taeer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160715/459fa86c/attachment.html>


More information about the nix-dev mailing list