I’m using devenv.sh to develop a Ruby app. I’m having trouble getting ruby-lsp to work though and get the following error when trying to run it. It seems like it’s picking up the wrong version.
❯ ruby-lsp
<internal:/nix/store/mq2n86q6l60yx86xxs3vd7af6s09nf5n-ruby-3.3.0/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require': linked to incompatible /nix/store/ccvbrdslj740g71a0dkqjc77akxxdyzp-ruby-3.3.5/lib/libruby.so.3.3 - /data/code/fabrik/.devenv/state/.bundle/ruby/3.3.0/gems/date-3.4.0/lib/date_core.so (LoadError)
from <internal:/nix/store/mq2n86q6l60yx86xxs3vd7af6s09nf5n-ruby-3.3.0/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from /data/code/fabrik/.devenv/state/.bundle/ruby/3.3.0/gems/date-3.4.0/lib/date.rb:4:in `<top (required)>'
from <internal:/nix/store/mq2n86q6l60yx86xxs3vd7af6s09nf5n-ruby-3.3.0/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from <internal:/nix/store/mq2n86q6l60yx86xxs3vd7af6s09nf5n-ruby-3.3.0/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from /nix/store/mq2n86q6l60yx86xxs3vd7af6s09nf5n-ruby-3.3.0/lib/ruby/3.3.0/time.rb:4:in `<top (required)>'
from <internal:/nix/store/mq2n86q6l60yx86xxs3vd7af6s09nf5n-ruby-3.3.0/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from <internal:/nix/store/mq2n86q6l60yx86xxs3vd7af6s09nf5n-ruby-3.3.0/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from /nix/store/a0azmrgjxkf70pxdnm3732mfj3rypxn0-ruby3.3-ruby-lsp-0.15.0/lib/ruby/gems/3.3.0/gems/ruby-lsp-0.15.0/lib/ruby_lsp/setup_bundler.rb:9:in `<top (required)>'
from /nix/store/a0azmrgjxkf70pxdnm3732mfj3rypxn0-ruby3.3-ruby-lsp-0.15.0/lib/ruby/gems/3.3.0/gems/ruby-lsp-0.15.0/exe/ruby-lsp:56:in `require_relative'
from /nix/store/a0azmrgjxkf70pxdnm3732mfj3rypxn0-ruby3.3-ruby-lsp-0.15.0/lib/ruby/gems/3.3.0/gems/ruby-lsp-0.15.0/exe/ruby-lsp:56:in `<top (required)>'
from /nix/store/a0azmrgjxkf70pxdnm3732mfj3rypxn0-ruby3.3-ruby-lsp-0.15.0/bin/ruby-lsp:18:in `load'
from /nix/store/a0azmrgjxkf70pxdnm3732mfj3rypxn0-ruby3.3-ruby-lsp-0.15.0/bin/ruby-lsp:18:in `<main>'
My devenv.nix:
{ pkgs, lib, config, inputs, ... }: {
packages = with pkgs; [
git
pkg-config
libyaml.dev
openssl.dev
sqlite
rubyPackages_3_3.ruby-lsp
];
enterShell = ''
bundle check || bundle
'';
enterTest = ''
rake
'';
languages.ruby = {
enable = true;
versionFile = ./.ruby-version;
};
processes.rails.exec = "bin/rails server";
}
.ruby-version
is 3.3.5
.
I’m running on NixOS unstable, my laptop is a bit out of date but the desktop is current and I get the same issue.
I also tried to override the ruby-lsp version (with .override { version = "0.22.0"; })
) but it still seemed to pick up version 0.15.0 so I think that’s wrong as well but possibly unrelated.