3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

WSL2 + VSCode + Solargraph で "Failed to start Solargraph: your 131072x1 screen size is bogus. expect trouble your 131072x1 screen size is bogus. expect trouble"

Last updated at Posted at 2019-10-04

solargrach を起動しようとするとよくわからないエラーで死にました。

image.png

どうも、vscodeから solargrach を起動しようとすると死ぬようなので、起動はvscodeの外で行うこととし、vscodeからは「外部のsolargraphサーバに接続」する形で利用しようと思います。

環境

  • Visual Studio Code 1.38.1
    • Remote Development 0.17.0
    • Remote - WSL 0.39.5
  • Windows 10 Pro Version 1903 Build 18990.1
  • Windows Subsystem for Linux 2
    • Ubuntu 18.04.2 LTS (GNU/Linux 4.19.67-microsoft-standard x86_64)
    • Ruby 2.6.5
    • solargraph 0.37.2

手順

以下の設定を追加

settings.json
{
  "solargraph.transport": "external",
  "solargraph.externalServer": {
    "host": "localhost",
    "port": 7658
  }
}

VSCodeを一度閉じます。

WSL2を開いて solargrach を起動します。

$ cd YOUR_PROJECT_DIRECTORY
$ bundle exec solargraph socket
Solargraph is listening PORT=7658 PID=5350

これでVSCodeを起動すると無事TCP経由で接続できました。

Solargraph is listening PORT=7658 PID=5350
[ANY] Solargraph initialized (6.4928773910005475 seconds)

image.png

補足

都度自分で bundle exec solargraph をたたくのが面倒なので、スクリプト書くなり適当にやってください。

参考

3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?