Skip to content

Commit

Permalink
Use absolute path to load .ruby-version file
Browse files Browse the repository at this point in the history
The ruby-lsp extension from VSCode editor sometimes tries to load this
`.ruby-version` file while its current working directory is not the root
of the repository. The ruby-lsp extension then fails to load.

By using an absolute path to load the `.ruby-version` file, this issue
is avoided.
  • Loading branch information
cbliard committed Oct 9, 2024
1 parent 4b2c3f8 commit 9c63014
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ source "https://rubygems.org"
# then we can use the new bundler syntax `ruby file: '.ruby-version'`.
# https://github.com/heroku/heroku-buildpack-ruby/issues/1408#issuecomment-1841596215

ruby File.read(".ruby-version").strip
ruby File.read(File.expand_path(".ruby-version", __dir__)).strip

gem "actionpack-xml_parser", "~> 2.0.0"
gem "activemodel-serializers-xml", "~> 1.0.1"
Expand Down

0 comments on commit 9c63014

Please sign in to comment.