-
Notifications
You must be signed in to change notification settings - Fork 214
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
Hello! Thanks for this awesome set of libraries.
This is not a bug report, rather a quick info dump for anyone who uses nix flakes and vscode-ruby-lsp and wants to use the custom Ruby activation to make use of the Ruby from their flake.nix
.
In essence, add a command to your flake.nix
outputs, hardcoded here to use aarch64-dawin
.
# used to help vscode-ruby-lsp find the appropriate ruby and gems
packages.aarch64-darwin.activate-ruby = pkgs.writeScriptBin "activate-ruby-nix" ''
echo "export GEM_HOME=\"$GEM_HOME\""
echo "export GEM_PATH=\"$GEM_PATH\""
echo "export PATH=\"$(command -v ruby | xargs dirname):$GEM_HOME/bin:\$PATH\""
'';
Add the follow lines to your VSCode config:
"rubyLsp.rubyVersionManager": "custom",
"rubyLsp.customRubyCommand": "eval \"$(nix run .#activate-ruby)\"",
Restart code, this will ensure the GEM_HOME
, GEM_PATH
and PATH
env variables are set correctly, and vscode-ruby-lsp
should now be able to find the appropriate Ruby exposed by your flake.
LandonSchropp, rbishop, wongyouth, fourseven and inscapist
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working