[Nix-dev] Rubygems and bundler

Andrew Morsillo andrew.morsillo at gmail.com
Thu Mar 7 05:18:24 CET 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
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. Trying to install those gems always fails
because the prerequisites to build the native extensions are not present.
2) For the gems that I do install with "rubyLibs.gemname" or "ruby-gemname"
doing a "bundle install" on my rails project as I would do in other
environments fails with "Gem::Exception: Cannot load gem at
[/nix/store/ddgq0g99hrpfiwppgrd89qjv2pzpm9qj-ruby-1.9.3-p194/lib/ruby/gems/1.9.1/cache/rake-10.0.3.gem]"


So this leads me to the following questions:

What is the best way to handle gems with native extensions?
Why can't bundler read the existing gems I have installed into the nix
store?
Are others running complex rails applications on nixos and if so what is
your setup?

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.

Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20130306/8469b310/attachment-0001.html 


More information about the nix-dev mailing list