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
[!] There was an error parsing Gemfile
: cannot instance_eval() a String with binary encoding, with no magic encoding comment and containing a non-US-ASCII character: \xC3. Bundler cannot continue.
#1410
Comments
Ok I've found the source of the bug:
with a french Do you consider this a bug or should I close this issue ? FYI, If I switch to Ruby 2.4.4 ( |
Hello, Could you tell me which Bundler version you used? ( Could you also share your Gemfile or the part around the comment with the |
It's definitely a bug, we should behave like MRI. |
This seems a variant of rubygems/bundler#6598 but with non-ASCII characters in the Gemfile and not a As a workaround, you can add this line at the top of the Gemfile: # encoding: UTF-8 |
@guizmaii I opened an issue and a PR to Bundler (see links above). MRI still works in this case, and TruffleRuby doesn't but I believe fixing the problem In Bundler by giving a proper encoding is better here. The reason of the exception in TruffleRuby is TruffleRuby needs to convert to a Java String for debugging support and that is unreliable if we cannot know the encoding. And so the debugger wouldn't know how to display this Not having a proper encoding is problematic anyway: |
Hi @eregon, Here's the info you asked:
No, I can't. I already shared the maximum I can. Sorry.
Thanks for the detailed answer ! |
Thanks for info.
No worry, I could reproduce with a Gemfile with the comment with I think we just need to wait for Bundler to merge my PR and make a new release now. |
Isn't it strange to fix bundler when we know that the bug is in Truffle ? Noob questions, sorry. |
I think @eregon is saying that there are issues with both projects. The issue with Bundler can manifest itself with MRI if your system's locale isn't set to UTF-8. These sorts of environmental encoding issues can be very tricky to debug so it's nice that we have an easy failing case here that we could contribute back upstream. We'll see what we can do on the TruffleRuby side to address the issue so existing versions of Bundler work. |
Ok thanks :) |
…=deivid-rodriguez Use UTF-8 for reading files including Gemfile ### What was the end-user problem that led to this PR? See #6660 and oracle/truffleruby#1410. ### What was your diagnosis of the problem? The above issue details the problem. ### What is your fix for the problem, implemented in this PR? To read the Gemfile and other files in Bundler with the default source encoding of Ruby, UTF-8, instead of the binary encoding which cannot interpret non-US-ASCII characters. ### Why did you choose this fix out of the possible options? Because it's what Ruby does for other source files. Fixes #6660.
…=deivid-rodriguez Use UTF-8 for reading files including Gemfile ### What was the end-user problem that led to this PR? See #6660 and oracle/truffleruby#1410. ### What was your diagnosis of the problem? The above issue details the problem. ### What is your fix for the problem, implemented in this PR? To read the Gemfile and other files in Bundler with the default source encoding of Ruby, UTF-8, instead of the binary encoding which cannot interpret non-US-ASCII characters. ### Why did you choose this fix out of the possible options? Because it's what Ruby does for other source files. Fixes #6660. (cherry picked from commit e71418e)
@guizmaii Bundler 1.16.4 was just released and I confirm it works now for a Gemfile with: # Easy google map intégration for rails
gem 'rake' So just updating bundler should solve it: We'll fix the underlying issue as @nirvdrum said, but that's considerably more involved than a simple |
Unfortunately, other things got in the way and I haven't addressed the core problem here. Since it wasn't presenting itself in Bundler any longer though, I think we can close this issue out. I'm tracking the eval encoding issue in a separate issue in our internal tracker. Please comment or re-open if you think I've closed this prematurely. |
Hi,
I was trying TruffleRuby for the first time and encountered a problem (bug?) really fast.
I installed the GraalVM / TruffleRuby 1.0.0-rc5 on a up to date MacOS, installed
bundler
and finally ranbundle install
on my Ruby project.Here's the answer I received:
Any idea how to fix this ?
The text was updated successfully, but these errors were encountered: