Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby on Rails - can't install nokogiri #1

Open
Quintasan opened this issue Aug 31, 2022 · 1 comment
Open

Ruby on Rails - can't install nokogiri #1

Quintasan opened this issue Aug 31, 2022 · 1 comment

Comments

@Quintasan
Copy link

Hi,

I generated a clean Ruby on Rails application using rails new test --api

Then I did nix run nixpkgs#bundix -- --ruby=ruby_3_1 to get the gemset.nix

When I try using the flake.nix provided here it fails with

direnv: loading ~/sauce/myconventionlist/.envrc
direnv: using flake
error: hash mismatch in fixed-output derivation '/nix/store/khyz0a6v1sac546cr7p5g68ap0w9nm6q-nokogiri-1.13.8.gem.drv':
         specified: sha256-NE8bxm/qx4flsgU8bpCV0fM2BQg+WN3yuNTu8le8zF8=
            got:    sha256-ecJ5KYsvIv1Odg9JmQx5MENrrBsc/v97rP8ZLzDt6jw=
error: 1 dependencies of derivation '/nix/store/riky8hrjwj5v2nr3waycxfmkf12blhmz-ruby3.1.2-nokogiri-1.13.8.drv' failed to build
error: 1 dependencies of derivation '/nix/store/g70h2ldxy9axja5salw97f8in7b7674i-rails-env.drv' failed to build
error: 1 dependencies of derivation '/nix/store/91i3qy9npfjxsnncjdskyav20x0pp6dk-nix-shell-env.drv' failed to build
direnv: nix-direnv: renewed cache
direnv: export ~XDG_DATA_DIRS

I discovered there's a difference between your gemset.nix and the one I got:

I don't see any special options being passed to nokogiri in your flake configuration. How did you make this work?

@jacobgreenleaf
Copy link

jacobgreenleaf commented Sep 10, 2022

This is related to a limitation in bundix when you depend on gems with native extensions. Current solutions are either maintaining separate unique gemset.nix files for each build arch (e.g. aarch64-darwin-gemset.nix) or mirroring what nixpkgs does to ensure it builds (passing --use-system-libraries and providing properly configured zlib, libxml2, libxslt, and on Darwin libiconv).

I ran into this issue as well (aarch64-darwin, M1 Mac Air).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants