Skip to content

Ruby Bundler

bundle install --deployment will try to fetch dependencies from the Internet.

This can cause issues like:

Could not reach host index.rubygems.org. Check your network connection and try
again.

To fix, using the following in the derivation:

{
  preBuild =
    let
      inherit ruby;
      gems = bundlerEnv {
        inherit ruby;
        # ...
      };
    in
    ''
      bundle config set deployment true
      mkdir -p vendor/bundle/ruby
      ln -s ${gems}/${ruby.gemPath} vendor/bundle/ruby/
    '';
}