-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setup_bundler's rails_app?
incompatible with non-ascii characters
#2463
Comments
@D-system what does the following return in your app?
|
I've also started seeing this error. My application.rb file has a single # Override Rails’ default public exception handling
config.exceptions_app = self.routes
|
Can you show the output of |
This problem doesn't seem to be isolated to multibyte characters. There's some encoding issue in play here. Adding Japanese or other multibyte characters to the fixture still passes the test because the file contents are read as UTF-8. Even forcing the file encoding to be US-ASCII passes the test. |
I created a revert #2466 while we're trying to understand what's going on, since this blocks people from using the LSP. |
If you run |
It also fails with |
#2469 should solve this but I'd still like to understand why if/why |
$ echo $LANG
en_US.UTF-8 |
|
I tried it with 0.17.4 and yes, it solved the issue. So the issue depends on the var env |
|
FYI: maintenance task had the same issue from ActiveStorage that reads CSV files in ASCII-8bit/binary even that file is text with UTF-8 encoding at upload time. |
Description
Reproduction steps
Having the config/application.rb with Japanese characters (eg: あ)
In https://github.com/Shopify/ruby-lsp/blob/88b85b810061aafd7d8d7078df6b5aa713979e54/test/fixtures/rails_application.rb add
あ
Details
From this change #2218 ruby-lsp error out on
ruby-lsp/lib/ruby_lsp/setup_bundler.rb
Line 292 in 88b85b8
Ruby-lsp: 0.17.14
Ruby: 3.3.4
Rails: 6.1.7.8
Error:
setup_bundler.rb:295:in 'match?': invalid byte sequence in US-ASCII (ArgumentError)
Full output:
Using
application_contents.force_encoding("UTF-8")
solve the problem.The text was updated successfully, but these errors were encountered: