EDIT - I got Solargraph working with WSL / VS Code, but I couldn’t get SketchUp debugging working. So I switched to a Windows environment, and everything’s working fine.
The Solargraph issue: It seems that solargraph was scanning across directories in my VSCode workspace, and getting an error from a non-ASCII character - � . Specifically this character was in a comment within a ruby snippet included with Alex Schreyer’s ruby editor, version 4.3. I’ll message him.
as_rubyeditor\snippets\08 - Transform selection.rb
Trying to set up for development & debugging in VSCode – following the guides here, and I’m having a problem with Solargraph:
Upon starting VSCode and loading a ruby file, I got:
Solargraph gem not found. Run gem install solargraph or update your Gemfile.
The gem was already installed. But I did some re-installing things and fiddling around and now I’m getting a new error:
Failed to start Solargraph: Error: [ArgumentError] invalid byte sequence in UTF-8
I do all my coding in WSL2 (Ubuntu 20.04 LTS), and I’ve never been able to get Solargraph working. Otherwise, WSL has been great. I’m using VSCode & Windows Terminal (bash). Ruby 2.7.1 is installed to the Ubuntu WSL, via ruby-install / ch-ruby.
I installed gems to WSL (via Windows Terminal bash):
which solargraph returns
I tried changing
Solargraph: Command Path to that path – same error.
I also tried starting vscode via WSL bash
I can set up for development in Windows if I need to, but WSL has worked so nicely up until now. I hear that Ruby on Windows can be troublesome, but I’ve never tried it.
edit- I tried reinstalling everything ( WSL Ubuntu / Ruby / VSCode ) – this time installing ruby as user instead of root – same error. Upon reinstallation of VS Code I noticed it kept all my old settings and my local extensions – WSL extensions were wiped.
Encountered an unrelated issue of etc 1.2 having problems with ruby 2.7.1 – solved by deleting etc gem files and reinstalling
gem install etc -v 1.1.0
Here is the print from
(click to expand)
bubba@BubbaBox:/mnt/c/Users/bubba$ gem env RubyGems Environment: - RUBYGEMS VERSION: 3.1.2 - RUBY VERSION: 2.7.1 (2020-03-31 patchlevel 83) [x86_64-linux] - INSTALLATION DIRECTORY: /home/bubba/.gem/ruby/2.7.1 - USER INSTALLATION DIRECTORY: /home/bubba/.gem/ruby/2.7.0 - RUBY EXECUTABLE: /home/bubba/.rubies/ruby-2.7.1/bin/ruby - GIT EXECUTABLE: /usr/bin/git - EXECUTABLE DIRECTORY: /home/bubba/.gem/ruby/2.7.1/bin - SPEC CACHE DIRECTORY: /home/bubba/.gem/specs - SYSTEM CONFIGURATION DIRECTORY: /home/bubba/.rubies/ruby-2.7.1/etc - RUBYGEMS PLATFORMS: - ruby - x86_64-linux - GEM PATHS: - /home/bubba/.gem/ruby/2.7.1 - /home/bubba/.rubies/ruby-2.7.1/lib/ruby/gems/2.7.0 - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :backtrace => false - :bulk_threshold => 1000 - REMOTE SOURCES: - https://rubygems.org/ - SHELL PATH: - /home/bubba/.gem/ruby/2.7.1/bin - /home/bubba/.rubies/ruby-2.7.1/lib/ruby/gems/2.7.0/bin - /home/bubba/.rubies/ruby-2.7.1/bin - /usr/local/sbin - /usr/local/bin - /usr/sbin - /usr/bin - /sbin - /bin - /usr/games - /usr/local/games - /mnt/c/Program Files/Oculus/Support/oculus-runtime - /mnt/c/Program Files (x86)/Common Files/Oracle/Java/javapath - /mnt/c/WINDOWS/system32 - /mnt/c/WINDOWS - /mnt/c/WINDOWS/System32/Wbem - /mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/ - /mnt/c/WINDOWS/System32/OpenSSH/ - /mnt/c/Program Files/PowerShell/7/ - /mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common - /mnt/c/Program Files/Git/cmd - /mnt/d/progs/ffmpeg/bin/ - /mnt/c/Users/bubba/AppData/Local/Microsoft/WindowsApps - /mnt/c/Users/bubba/AppData/Local/GitHubDesktop/bin - /mnt/d/OneDrive/_work/hugo/bin - /mnt/c/Users/bubba/AppData/Local/Programs/Microsoft VS Code/bin - /snap/bin