-
I have a The contents of my watch_file .ruby-version
use flake
layout ruby
PATH_add bin The most notable part here is Inside of neovim my # On the CLI, outside of neovim
$ echo $GEM_HOME
/path/to/cwd/.direnv/ruby
# Inside of neovim
:!echo $GEM_HOME
/nix/store/k2jwbpszhzrsh0q4idxjw3gs2x5wbs7n-neovim-ruby-env/lib/ruby/gems/3.3.0 I'm assuming that since the require("lspconfig").ruby_lsp.setup({}) The contents of my LSP log:
The contents of my `flake.nix` (not super important for this problem).
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
nixpkgs-ruby = {
url = "github:bobvanderlinden/nixpkgs-ruby";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
nixpkgs,
nixpkgs-ruby,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
ruby = nixpkgs-ruby.lib.packageFromRubyVersionFile {
file = ./.ruby-version;
inherit system;
};
in {
devShell = with pkgs;
mkShell {
buildInputs = [
ruby
postgresql_17
libyaml # NOTE: for psych gem
imagemagick # NOTE: for paperclip
];
};
});
} |
Beta Was this translation helpful? Give feedback.
Answered by
jessevdp
Feb 18, 2025
Replies: 1 comment
-
I figured out that I can use require("lspconfig").ruby_lsp.setup({
cmd = { "direnv", "exec", ".", "ruby-lsp" },
}) I'm hoping this helps someone 😄 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
jessevdp
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I figured out that I can use
direnv exec . <COMMAND>
to get around my issue:I'm hoping this helps someone 😄