Skip to content

shepting/ruby-nix-sample

Repository files navigation

ruby-nix-sample

A sample project using Nix to set up a Ruby environment.

Testing

There exists a test_nix.sh file which shows the current issues with this setup. It prints out the LOAD_PATH and GEM_PATH for Ruby and also lists any issues loading gems. This runs on CI so you can verify that things are still working.

Previous Issues (now fixed)

Loading Certain Gems

Update: It turns out that these particular gems just had a different name that needed to be requireed than their Gem name.

You can see that the ruby_info.sh script prints out where ruby and bundler are coming from to help debug issues. You can see that there are a few gems that are failing to load, although I don't know the root cause:

Image of gem loading issue

Load Errors from Duplicate require Paths

You can see lower how there is output when trying to load certain gems, json-2.3.0 in this case. I appears that there is a copy both in gems-bundler-env (which I would expect) and also in ruby2.6.6-json-2.3.0 (which I would not expect). Image of gem loading issue

I have one potential investigation (or red-herring) which is that nix-shell which build derivations for both:

  • gems-bundler-env
  • wrapped-ruby-gems-bundler-env Image of nix-shell issue

It's not clear why there are multiple copies of these gems, but it's clearly causing issues with constants being initialized twice, etc.

About

A sample project using Nix to set up a Ruby environment.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors