Delbert's Octopress Blog

A blogging framework for hackers.

Failure on 'Ruby dk.rb Init'

想在 Windows 下重新安装 Ruby,结果在执行 ruby dk.rb init 的命令时就出现了错误:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
ruby dk.rb init
[INFO] found RubyInstaller v1.9.3 at C:/Ruby193
C:/Ruby193/lib/ruby/1.9.1/win32/registry.rb:173:in `tr': invalid byte sequence in UTF-8 (ArgumentError)
        from C:/Ruby193/lib/ruby/1.9.1/win32/registry.rb:173:in `initialize'
        from C:/Ruby193/lib/ruby/1.9.1/win32/registry.rb:231:in `exception'
        from C:/Ruby193/lib/ruby/1.9.1/win32/registry.rb:231:in `raise'
        from C:/Ruby193/lib/ruby/1.9.1/win32/registry.rb:231:in `check'
        from C:/Ruby193/lib/ruby/1.9.1/win32/registry.rb:277:in `EnumKey'
        from C:/Ruby193/lib/ruby/1.9.1/win32/registry.rb:551:in `each_key'
        from dk.rb:119:in `block (2 levels) in scan_for'
        from C:/Ruby193/lib/ruby/1.9.1/win32/registry.rb:389:in `open'
        from C:/Ruby193/lib/ruby/1.9.1/win32/registry.rb:496:in `open'
        from dk.rb:118:in `block in scan_for'
        from dk.rb:116:in `each'
        from dk.rb:116:in `scan_for'
        from dk.rb:138:in `block in installed_rubies'
        from dk.rb:138:in `collect'
        from dk.rb:138:in `installed_rubies'
        from dk.rb:146:in `init'
        from dk.rb:313:in `run'
        from dk.rb:332:in `<main>'

将环境变量中的 LANGLC_ALL 去掉后,重新开启一个命令行执行即可。

有必要的话,安装完 DevKit 再将环境变量添加回去。

Delbert 自己摸索了一下午试出来的……

Comments