0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Devcontainer の Rails 開発環境で Ruby LSP が効かない場合の対処

Last updated at Posted at 2025-01-04

はじめに

Devcontainer で Rails 開発環境を作ったときに Ruby LSP が動作しなかったので備忘録として残しておきます。

原因

Devcontainer の場合、バージョン管理にわざわざ rbenv を使わず、Docker コンテナに直接システムインストールした Ruby を使うことが多いです。

しかし、VSCode の Ruby LSP はプロジェクト内に .ruby-version ファイルがあると rbenv 経由で Ruby を呼び出そうとします。

rails new コマンドで作ったプロジェクトには .ruby-version ファイルが用意されています。

解決方法

以下の手順で解決できます。

  1. .ruby-version ファイルを削除
  2. Ruby LSP を再起動

以上です。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?