ruby-lsp icon indicating copy to clipboard operation
ruby-lsp copied to clipboard

fails to detect correct ruby version

Open floh96 opened this issue 11 months ago • 6 comments

Description

Reproduction steps

When I try to start the ruby lsp server it fails with the following error message Failed to activate asdf environment: The Ruby LSP requires Ruby 3.0 or newer to run. This project is using 2.6.6.

I'm using asdf as ruby version manager with the following setup: I have set Ruby 2.6.6 as my global ruby version via ~/.tool-versions. The project is using ruby 3.2.2 which is set via projectdir/.ruby-version. Asdf is configured to respect .ruby-version and asdf current inside the project directory says ruby 3.2.2 is the current ruby version. Output of the command /usr/bin/fish -i -c 'asdf exec ruby -rjson -e "STDERR.printf(%{RUBY_ENV_ACTIVATE%sRUBY_ENV_ACTIVATE}, JSON.dump({ env: ENV.to_h, ruby_version: RUBY_VERSION, yjit: defined? (RubyVM::YJIT) }))"':

RUBY_ENV_ACTIVATE{"env":{"PATH":"/home/fheberl/.asdf/installs/ruby/3.2.2/bin:/home/fheberl/Projekte/infrastructure:/home/fheberl/.local/bin:/home/fheberl/.asdf/shims:/home/fheberl/.asdf/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin","SHELL":"/usr/bin/fish","SESSION_MANAGER":"local/unix:@/tmp/.ICE-unix/4419,unix/unix:/tmp/.ICE-unix/4419","COLORTERM":"truecolor","XDG_MENU_PREFIX":"gnome-","TERM_PROGRAM_VERSION":"1.87.0","asdf_data_dir":"/home/fheberl/.asdf","omp_lastcommand":"asdf current","SSH_AUTH_SOCK":"/run/user/1000/keyring/ssh","MEMORY_PRESSURE_WRITE":"c29tZSAyMDAwMDAgMjAwMDAwMAA=","XMODIFIERS":"@im=ibus","DESKTOP_SESSION":"gnome","NO_AT_BRIDGE":"1","EDITOR":"code --wait --new-window","PWD":"/home/fheberl/Projekte/nix-wie-weg-de","LOGNAME":"fheberl","XDG_SESSION_DESKTOP":"gnome","XDG_SESSION_TYPE":"wayland","SYSTEMD_EXEC_PID":"4529","XAUTHORITY":"/run/user/1000/.mutter-Xwaylandauth.PWOBK2","VSCODE_GIT_ASKPASS_NODE":"/usr/share/code/code","ASDF_DEFAULT_TOOL_VERSIONS_FILENAME":".tool-versions","VSCODE_INJECTION":"1","GDM_LANG":"de_DE.UTF-8","HOME":"/home/fheberl","USERNAME":"fheberl","LANG":"de_DE.UTF-8","XDG_CURRENT_DESKTOP":"GNOME","POSH_SHELL_VERSION":"3.7.0","MEMORY_PRESSURE_WATCH":"/sys/fs/cgroup/user.slice/user-1000.slice/[email protected]/session.slice/[email protected]/memory.pressure","VTE_VERSION":"7402","WAYLAND_DISPLAY":"wayland-0","GIT_ASKPASS":"/usr/share/code/resources/app/extensions/git/dist/askpass.sh","GNOME_TERMINAL_SCREEN":"/org/gnome/Terminal/screen/4d14c413_2032_45f6_9ee9_3321be0ed8be","ASDF_DATA_DIR":"/home/fheberl/.asdf","CHROME_DESKTOP":"code-url-handler.desktop","VSCODE_GIT_ASKPASS_EXTRA_ARGS":"","GNOME_SETUP_DISPLAY":":1","XDG_SESSION_CLASS":"user","TERM":"xterm-256color","ASDF_DIR":"/home/fheberl/.asdf","USER":"fheberl","VSCODE_GIT_IPC_HANDLE":"/run/user/1000/vscode-git-b2e5338e99.sock","GNOME_TERMINAL_SERVICE":":1.137","DISPLAY":":0","SHLVL":"4","QT_IM_MODULE":"ibus","POSH_THEME":"/home/fheberl/.oh-my-posh/themes/fish.json","XDG_RUNTIME_DIR":"/run/user/1000","VSCODE_GIT_ASKPASS_MAIN":"/usr/share/code/resources/app/extensions/git/dist/askpass-main.js","XDG_DATA_DIRS":"/home/fheberl/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/:/usr/share/code/resources/app/out/vs/workbench/contrib/terminal/browser/media/fish_xdg_data","omp_last_status_generation":"5","GDK_BACKEND":"x11","ASDF_CONFIG_FILE":"/home/fheberl/.asdfrc","GDMSESSION":"gnome","ORIGINAL_XDG_CURRENT_DESKTOP":"GNOME","DBUS_SESSION_BUS_ADDRESS":"unix:path=/run/user/1000/bus","RUBYLIB":"/home/fheberl/.asdf/plugins/ruby/rubygems-plugin","TERM_PROGRAM":"vscode"},"ruby_version":"3.2.2","yjit":"constant"}RUBY_ENV_ACTIVATE

  • OS: Fedora 39
  • Shell: fish
  • VSCode version: 1.87.0
  • VSCode Ruby LSP version: 0.5.12
  • Ruby version: 3.2.2

floh96 avatar Mar 11 '24 09:03 floh96