[ruby-list:50431] bundle exec での日本語を含む引数の文字化け workaround (Windows環境)
From:
Toshihiko Ichida <dogatana@...>
Date:
2016-10-16 05:38:13 UTC
List:
ruby-list #50431
市田です。
https://bugs.ruby-lang.org/issues/12841 についてソースは修正されたよう
ですが、配布バイナリが修正されるまでの間の workaround としてパッチ
を考えてみました。
--- bundler-1.13.5\lib\bundler\cli\exec.rb.org Sun Oct 16 14:22:56 2016
+++ bundler-1.13.5\lib\bundler\cli\exec.rb Sun Oct 16 14:26:51 2016
@@ -49,7 +49,7 @@
def kernel_exec(*args)
ui = Bundler.ui
Bundler.ui = nil
- Kernel.exec(*args)
+ Kernel.exec(args.join ' ')
rescue Errno::EACCES, Errno::ENOEXEC
Bundler.ui = ui
Bundler.ui.error "bundler: not executable: #{cmd}"
一応これで bundle exec 経由で起動した場合でも期待どおりに動作するよう
になりました。
> ruby test.rb あ
arg: あ, enc: Windows-31J, bytes: 82-a0
> bundle exec ruby test.rb あ
arg: あ, enc: Windows-31J, bytes: 82-a0