Open jared-thoughtbot opened 1 month ago
Maybe this is similar to a problem I recently experienced (#2369 ). The cause was the default terminal in VSCode not being compatible.
In fish shell
, you can try changing the terminal size with the mouse or adjust the shell variables in the ~/.config/fish/config.fish
file with values like
set -x COLUMNS 114
set -x LINES 48
or whatever size you prefer as long as it's more than 1. based: https://fishshell.com/docs/current/cmds/set.html
another quick solution is to change the default terminal in VSCode; that might fix the issue.
@motebaya amazing, thank you! Both options worked but I settled on hardcoding the columns and lines in config.fish
.
Weirdly it still doesn't detect my version manager but it is working 🤷
2024-07-27 13:11:22.742 [info] (albaik-web) Checking if chruby is available on the path with command: /usr/bin/fish -i -c 'chruby --version'
2024-07-27 13:11:23.748 [info] (albaik-web) Checking if rbenv is available on the path with command: /usr/bin/fish -i -c 'rbenv --version'
2024-07-27 13:11:24.752 [info] (albaik-web) Checking if rvm is available on the path with command: /usr/bin/fish -i -c 'rvm --version'
2024-07-27 13:11:25.766 [info] (albaik-web) Checking if asdf is available on the path with command: /usr/bin/fish -i -c 'asdf --version'
2024-07-27 13:11:26.776 [info] (albaik-web) Discovered version manager none
2024-07-27 13:11:26.777 [info] (albaik-web) Running command: `ruby -W0 -rjson -e 'STDERR.print({ env: ENV.to_h, yjit: !!defined?(RubyVM::YJIT), version: RUBY_VERSION }.to_json)'` in /home/jaredt/projects/albaik-web using shell: /bin/fish
2024-07-27 13:11:38.653 [info] (albaik-web) Ruby LSP> Skipping custom bundle setup since /home/jaredt/projects/albaik-web/.ruby-lsp/Gemfile.lock already exists and is up to date
Ruby LSP> Running bundle install for the custom bundle. This may take a while...
Ruby LSP> Command: (bundle check || bundle install) 1>&2
The Gemfile's dependencies are satisfied
2024-07-27 13:11:41.637 [info] (albaik-web) Initializing Ruby LSP v0.17.9...
2024-07-27 13:11:41.706 [info] (albaik-web) Finished initializing Ruby LSP!
2024-07-27 13:11:41.754 [info] (albaik-web) [Standard Ruby] Activating Standard Ruby LSP addon v1.39.1
2024-07-27 13:11:42.647 [info] (albaik-web) [Standard Ruby] Initialized Standard Ruby LSP addon 1.39.1
2024-07-27 13:11:42.647 [info] (albaik-web) Activating Ruby LSP Rails addon v0.3.11
2024-07-27 13:11:42.692 [info] (albaik-web) Ruby LSP Rails booting server
2024-07-27 13:11:49.531 [info] (albaik-web) Finished booting Ruby LSP Rails server
@jared-thoughtbot Have you tried setting the version manager manually? i think in log, LSP checking version manager because you haven't set it up yet.
Here's what i did:
CTRL + SHIFT + P
, type version manager
-> change version manager
-> and select the version manager you have. .ruby_version
file with the ruby version you're using in current directory project. RUBY_VERSION
variable to the ENV.it might help.
I have the same issue but only in 1 project:
Automatic Ruby environment activation with rvm failed: Unexpected token 'N', "No preset "... is not valid JSON
Using RVM to manage Ruby but also asdf to manage NodeJS. Bash is my shell. Annoyingly, it’s not consistent, i.e. the LSP works for gems and all other Ruby/Rails projects I work on except for one. Last week it worked without issues IIRC.
@ur5us can you provide the content from the Output tab with Ruby LSP
selected from the dropdown? Eg.
@jared-thoughtbot I think I solved it. The problem was asdf complaining about NodeJS version as per .tool-versions
not installed, though IMO that should not affect the Ruby LSP in the first place as I’m using RVM to manage my Ruby versions. For reference:
2024-08-08 16:42:45.145 [info] (app) Running command: `/home/ur5us/.rvm/bin/rvm-auto-ruby -W0 -rjson -e 'STDERR.print({ env: ENV.to_h, yjit: !!defined?(RubyVM::YJIT), version: RUBY_VERSION }.to_json)'` in /home/ur5us/dev/redacted/app using shell: /usr/bin/bash
2024-08-08 16:42:47.377 [error] (app) Tried parsing invalid JSON environment: No preset version installed for command node
Please install a version by running one of the following:
asdf install nodejs 20.16.0
or add one of the following versions in your config file at /home/ur5us/dev/redacted/app/.tool-versions
nodejs 18.17.1
nodejs 20.13.0
nodejs 20.14.0
nodejs 20.15.0
nodejs 20.15.1
nodejs 22.0.0
{"env":{"SHELL":"/bin/bash","SESSION_MANAGER":"local/dragonfly:@/tmp/.ICE-unix/1538,unix/dragonfly:/tmp/.ICE-unix/1538","CSF_MDTVTexturesDirectory":"/usr/share/opencascade/resources/Textures","XDG_CONFIG_DIRS":"/run/xdg/:/etc/xdg/:/usr/share/xdg/","XDG_SESSION_PATH":"/org/freedesktop/DisplayManager/Session0","HISTCONTROL":"ignoredups","XDG_MENU_PREFIX":"gnome-","rvm_delete_flag":"0","__GL_MaxFramesAllowed":"1","rvm_prefix":"/home/ur5us","CSF_DrawPluginDefaults":"/usr/share/opencascade/resources/DrawResources","HISTSIZE":"1000","CSF_LANGUAGE":"us","SSH_AUTH_SOCK":"/run/user/1000/keyring/ssh","CSF_MIGRATION_TYPES":"/usr/share/opencascade/resources/StdResource/MigrationSheet.txt","ELECTRON_RUN_AS_NODE":"1","MY_RUBY_HOME":"/home/ur5us/.rvm/rubies/ruby-3.3.4","XMODIFIERS":"@im=ibus","DESKTOP_SESSION":"budgie-desktop","CSF_OCCTResourcePath":"/usr/share/opencascade/resources","NO_AT_BRIDGE":"1","VSCODE_AMD_ENTRYPOINT":"vs/workbench/api/node/extensionHostProcess","CSF_STEPDefaults":"/usr/share/opencascade/resources/XSTEPResource","EMSCRIPTEN_ROOT":"/usr/share/emscripten/emsdk","EDITOR":"code-oss -w","GTK_MODULES":"gail:atk-bridge:appmenu-gtk-module:appmenu-gtk-module:appmenu-gtk-module:appmenu-gtk-module:appmenu-gtk-module","RUBY_VERSION":"ruby-3.3.4","PWD":"/home/ur5us/dev/redacted/app","LOGNAME":"ur5us","XDG_SESSION_DESKTOP":"budgie-desktop","XDG_SESSION_TYPE":"x11","DRAWHOME":"/usr/share/opencascade/resources/DrawResources","BUNDLER_EDITOR":"code-oss","rvm_version":"1.29.12-next (master)","VSCODE_CODE_CACHE_PATH":"/home/ur5us/.config/Code/CachedData/b1c0a14de1414fcdaa400695b4db1c0799bc3124","XAUTHORITY":"/home/ur5us/.Xauthority","CSF_StandardLiteDefaults":"/usr/share/opencascade/resources/StdResource","XDG_GREETER_DATA_DIR":"/var/lib/lightdm-data/ur5us","MOTD_SHOWN":"pam","GDM_LANG":"en_NZ.UTF-8","BINARYEN_ROOT":"/usr","HOME":"/home/ur5us","LANG":"en_NZ.UTF-8","XDG_CURRENT_DESKTOP":"Budgie:GNOME","BINARYEN":"/usr","VSCODE_IPC_HOOK":"/run/user/1000/vscode-0b167dcd-1.92-main.sock","PROMPT_COMMAND":"history -a;","XDG_SEAT_PATH":"/org/freedesktop/DisplayManager/Seat0","VSCODE_L10N_BUNDLE_LOCATION":"","CSF_ShadersDirectory":"/usr/share/opencascade/resources/Shaders","CHROME_DESKTOP":"code-oss.desktop","CSF_EXCEPTION_PROMPT":"1","CSF_XmlOcafResource":"/usr/share/opencascade/resources/XmlOcafResource","rvm_bin_path":"/home/ur5us/.rvm/bin","CSF_SHMessage":"/usr/share/opencascade/resources/SHMessage","GEM_PATH":"/home/ur5us/.rvm/gems/ruby-3.3.4:/home/ur5us/.rvm/gems/ruby-3.3.4@global","GEM_HOME":"/home/ur5us/.rvm/gems/ruby-3.3.4","XDG_SESSION_CLASS":"user","ASDF_DIR":"/home/ur5us/.asdf","USER":"ur5us","CSF_StandardDefaults":"/usr/share/opencascade/resources/StdResource","CSF_IGESDefaults":"/usr/share/opencascade/resources/XSTEPResource","VISUAL":"/usr/bin/nano","DISPLAY":":0","CSF_XCAFDefaults":"/usr/share/opencascade/resources/StdResource","VSCODE_PID":"631451","SHLVL":"0","INPUTRC":"/etc/inputrc","QT_IM_MODULE":"ibus","NO_GAIL":"1","VSCODE_CWD":"/home/ur5us","CSF_PluginDefaults":"/usr/share/opencascade/resources/StdResource","CSF_TObjMessage":"/usr/share/opencascade/resources/TObj","rvm_ruby_string":"ruby-3.3.4","CASROOT":"/usr","VSCODE_CRASH_REPORTER_PROCESS_TYPE":"extensionHost","XDG_RUNTIME_DIR":"/run/user/1000","CSF_XSMessage":"/usr/share/opencascade/resources/XSMessage","GTK3_MODULES":"xapp-gtk3-module","MMGT_CLEAR":"1","XDG_DATA_DIRS":"/home/ur5us/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop","GDK_BACKEND":"x11","PATH":"/home/ur5us/.rvm/gems/ruby-3.3.4/bin:/home/ur5us/.rvm/gems/ruby-3.3.4@global/bin:/home/ur5us/.rvm/rubies/ruby-3.3.4/bin:/home/ur5us/.rvm/bin:/home/ur5us/.asdf/shims:/home/ur5us/.asdf/bin:/home/ur5us/.local/bin:/home/ur5us/bin:/usr/sbin:/usr/bin:/usr/local/bin:/snap/bin:/usr/local/bin:/home/ur5us/.cargo/bin:/home/ur5us/.local/bin:/home/ur5us/bin::/home/ur5us/.dotnet","CSF_TObjDefaults":"/usr/share/opencascade/resources/StdResource","HISTIGNORE":"history:ls:cd:exit","GDMSESSION":"budgie-desktop","ORIGINAL_XDG_CURRENT_DESKTOP":"Budgie:GNOME","DBUS_SESSION_BUS_ADDRESS":"unix:path=/run/user/1000/bus","VSCODE_NLS_CONFIG":"{\"userLocale\":\"en-us\",\"osLocale\":\"en-nz\",\"resolvedLanguage\":\"en\",\"defaultMessagesFile\":\"/usr/share/vscode/resources/app/out/nls.messages.json\",\"locale\":\"en\",\"availableLanguages\":{}}","MAIL":"/var/spool/mail/ur5us","IRBRC":"/home/ur5us/.rvm/rubies/ruby-3.3.4/.irbrc","DRAWDEFAULT":"/usr/share/opencascade/resources/DrawResources/DrawDefault","GIO_LAUNCHED_DESKTOP_FILE_PID":"631451","GIO_LAUNCHED_DESKTOP_FILE":"/usr/share/applications/code-oss.desktop","VSCODE_HANDLES_UNCAUGHT_ERRORS":"true","rvm_path":"/home/ur5us/.rvm"},"yjit":true,"version":"3.3.4"}
Description
Error
My environment
Reproduction steps
code .
from WSL consoleError message
Output tab (Ruby LSP)
Running commands directly in terminal (Fish shell)
Notes
your 131072x1 screen size is bogus. expect trouble
- I have no idea about this but it doesn't sound good 🙃