Last active
December 29, 2016 02:20
-
-
Save tygerbytes/f40735f107a28be4897e669b61a0117b to your computer and use it in GitHub Desktop.
Ruby 2.3 on Windows: Fix "incompatible character encoding: UTF-8 and ASCII-8BIT" error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/ruby/2.3.0/resolv.rb b/lib/ruby/2.3.0/resolv.rb | |
index 9a981b9..c519e0e 100644 | |
--- a/lib/ruby/2.3.0/resolv.rb | |
+++ b/lib/ruby/2.3.0/resolv.rb | |
@@ -773,7 +773,7 @@ class Resolv | |
service = [host, port] | |
id = DNS.allocate_request_id(host, port) | |
request = msg.encode | |
- request[0,2] = [id].pack('n') | |
+ request[0,2] = [id].pack('U') | |
return @senders[[service, id]] = | |
Sender.new(request, data, sock, host, port) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After installing Ruby 2.3 on windows,
gem install bundle
fails with the following error:Edit
resolv.rb
as shown in the gist and make the change on line 776. Then try runninggem install bundle
again.