bobvanderlinden / nixpkgs-ruby

A Nix repository with all Ruby versions being kept up-to-date automatically

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

version `GLIBC_ABI_DT_RELR' not found

socherbyc opened this issue · comments

I'm trying to use devenv in a project that uses Ruby 3.0, Rails 6.1 and pg gem, but I'm getting this error after typing rails c:

version `GLIBC_ABI_DT_RELR' not found

I managed to reproduce this error by creating a simple project like this:

# devenv.yaml
inputs:
  nixpkgs:
    url: github:NixOS/nixpkgs/nixpkgs-unstable
  nixpkgs-ruby:
    url: github:bobvanderlinden/nixpkgs-ruby
# devenv.nix
{ pkgs, ... }:

{
  packages = with pkgs; [
    postgresql # pqdev
    shared-mime-info # without it I got other error
  ]

  languages.ruby = {
    enable = true;
    version = "3.0.6";
  };

  env.FREEDESKTOP_MIME_TYPES_PATH="${pkgs.shared-mime-info}/share/mime/packages/freedesktop.org.xml";
}
devenv shell # ok
gem install rails -v 6.1 # ok
rails new blog --api --database=postgresql # ok
cd blog
rails c # error
Full output (Click to expand)
user@nixos:~/project/blog$ rails c
There is a version mismatch between the Spring client (2.1.1) and the server (4.1.1).
Restarting to resolve.
/home/user/project/.devenv/state/.bundle/ruby/3.0.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require': /nix/store/9xfad3b5z4y00mzmk2wnn4900q0qmxns-glibc-2.35-224/li
b/libc.so.6: version `GLIBC_ABI_DT_RELR' not found (required by /nix/store/yaz7pyf0ah88g2v505l38n0f3wg2vzdj-glibc-2.37-8/lib/libresolv.so.2) - /home/user/project/.devenv/state/.bundle/ruby/3.0.0/gems/pg-1.5.
3/lib/pg_ext.so (LoadError)
        from /home/user/project/.devenv/state/.bundle/ruby/3.0.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /home/user/project/.devenv/state/.bundle/ruby/3.0.0/gems/activesupport-6.0.6.1/lib/active_support/dependencies.rb:324:in `block in require'
        from /home/user/project/.devenv/state/.bundle/ruby/3.0.0/gems/activesupport-6.0.6.1/lib/active_support/dependencies.rb:291:in `load_dependency'
        from /home/user/project/.devenv/state/.bundle/ruby/3.0.0/gems/activesupport-6.0.6.1/lib/active_support/dependencies.rb:324:in `require'
        from /home/user/project/.devenv/state/.bundle/ruby/3.0.0/gems/pg-1.5.3/lib/pg.rb:49:in `block in <module:PG>'
        from /home/user/project/.devenv/state/.bundle/ruby/3.0.0/gems/pg-1.5.3/lib/pg.rb:37:in `block in <module:PG>'
        from /home/user/project/.devenv/state/.bundle/ruby/3.0.0/gems/pg-1.5.3/lib/pg.rb:42:in `<module:PG>'
        from /home/user/project/.devenv/state/.bundle/ruby/3.0.0/gems/pg-1.5.3/lib/pg.rb:6:in `<main>'
        from /home/user/project/.devenv/state/.bundle/ruby/3.0.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /home/user/project/.devenv/state/.bundle/ruby/3.0.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /nix/store/2b15cd7r9hqn6by7ifqpw1pz8wi913z0-ruby-3.0.6/lib/ruby/3.0.0/bundler/runtime.rb:60:in `block (2 levels) in require'
        from /nix/store/2b15cd7r9hqn6by7ifqpw1pz8wi913z0-ruby-3.0.6/lib/ruby/3.0.0/bundler/runtime.rb:55:in `each'
        from /nix/store/2b15cd7r9hqn6by7ifqpw1pz8wi913z0-ruby-3.0.6/lib/ruby/3.0.0/bundler/runtime.rb:55:in `block in require'
        from /nix/store/2b15cd7r9hqn6by7ifqpw1pz8wi913z0-ruby-3.0.6/lib/ruby/3.0.0/bundler/runtime.rb:44:in `each'
        from /nix/store/2b15cd7r9hqn6by7ifqpw1pz8wi913z0-ruby-3.0.6/lib/ruby/3.0.0/bundler/runtime.rb:44:in `require'
        from /nix/store/2b15cd7r9hqn6by7ifqpw1pz8wi913z0-ruby-3.0.6/lib/ruby/3.0.0/bundler.rb:175:in `require'
        from /home/user/project/blog/config/application.rb:20:in `<top (required)>'
        from /home/user/project/.devenv/state/.bundle/ruby/3.0.0/gems/spring-2.1.1/lib/spring/application.rb:92:in `require'
        from /home/user/project/.devenv/state/.bundle/ruby/3.0.0/gems/spring-2.1.1/lib/spring/application.rb:92:in `preload'
        from /home/user/project/.devenv/state/.bundle/ruby/3.0.0/gems/spring-2.1.1/lib/spring/application.rb:157:in `serve'
        from /home/user/project/.devenv/state/.bundle/ruby/3.0.0/gems/spring-2.1.1/lib/spring/application.rb:145:in `block in run'
        from /home/user/project/.devenv/state/.bundle/ruby/3.0.0/gems/spring-2.1.1/lib/spring/application.rb:139:in `loop'
        from /home/user/project/.devenv/state/.bundle/ruby/3.0.0/gems/spring-2.1.1/lib/spring/application.rb:139:in `run'
        from /home/user/project/.devenv/state/.bundle/ruby/3.0.0/gems/spring-2.1.1/lib/spring/application/boot.rb:19:in `<top (required)>'
        from <internal:/nix/store/2b15cd7r9hqn6by7ifqpw1pz8wi913z0-ruby-3.0.6/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/nix/store/2b15cd7r9hqn6by7ifqpw1pz8wi913z0-ruby-3.0.6/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from -e:1:in `<main>'

It could very well be related to #80 because nixpkgs-ruby was still following an older nixpkgs version. There is a difference in glibc between the latest nixpkgs and the one nixpkgs-ruby was following and unfortunately differences in glibc can cause issues.

I've just updated nixpkgs to use nixos-23.05. So updating nixpkgs-ruby should resolve the issue.

Alternatively you can make nixpkgs-ruby follow a different nixpkgs version (like nixpkgs-unstable).

  nixpkgs-ruby:
    url: github:bobvanderlinden/nixpkgs-rub
    inputs:
      nixpkgs:
        follows: nixpkgs

This should be resolved with newer versions of nixpkgs. Reopen if needed.