Configure ruby's gem paths on NixOS?

121 views
Skip to first unread message

Ivan Brennan

unread,
Apr 27, 2018, 9:33:04 AM4/27/18
to nix-devel
I'd like to use [interactive_editor](https://github.com/jberkel/interactive_editor), a gem that lets you launch a Vim instance within IRB:

    require 'rubygems'
    require 'interactive_editor'
    vi

I'm trying to set this up on NixOS. My environment.systemPackages includes ruby (2.4.3).
I used bundlerEnv to package interactive_editor and wrote an overlay for it.
I also added the resulting package to my environment.systemPackages, though I'm not sure whether I should, since it's a library and not an executable app.

At the moment, Ruby cannot find the interactive_editor gem in the nix store.
Running `gem environment` shows,
  - GEM PATHS:
     - /home/ivan/.gem/ruby/2.4.0
     - /nix/store/xxxx-ruby-2.4.3/lib/ruby/gems/2.4.0

If I try to require interactive_editor in IRB, I get:
    LoadError: cannot load such file -- interactive_editor

How can I fix this?

An aside: I wanted ruby globally available because the fzf.vim plugin uses a ruby script to generate previews iff the system has a ruby executable.
I'm building Vim with ruby support already, so maybe there's another way this could be handled, but I haven't figured it out yet.
Reply all
Reply to author
Forward
0 new messages