我已经在我的计算机上安装了Ruby 1.92,并且想要安装rails。
当我运行:gem install rails
时,收到如下错误消息:
*D:\Ruby192\Devkit>gem install rails
*ERROR: Error installing rails:
The 'json' native gem requires installed build tools.
Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'**
然后我下载DevKit 4.5.2或DevKit 3.5并尝试将它们作为:
D:\Ruby192\Devkit>ruby dk.rb init
我总是收到错误消息:
d:/Ruby192/lib/ruby/1.9.1/win32/registry.rb:175:in `tr': invalid byte sequence in UTF-8 (ArgumentError)
from d:/Ruby192/lib/ruby/1.9.1/win32/registry.rb:175:in `initialize'
from d:/Ruby192/lib/ruby/1.9.1/win32/registry.rb:233:in `exception'
from d:/Ruby192/lib/ruby/1.9.1/win32/registry.rb:233:in `raise'
from d:/Ruby192/lib/ruby/1.9.1/win32/registry.rb:233:in `check'
from d:/Ruby192/lib/ruby/1.9.1/win32/registry.rb:256:in `OpenKey'
from d:/Ruby192/lib/ruby/1.9.1/win32/registry.rb:387:in `open'
from d:/Ruby192/lib/ruby/1.9.1/win32/registry.rb:498: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>'
你们对这个问题有什么建议吗?
答案 0 :(得分:1)
我遇到了同样的情况。我想你可能想要安装json
库。您应该使用msys.bat
并在此终端上安装json
。
msys.bat
- &gt;它会调用一个新的终端。gem install json
在这个终端上。gem install rails
。答案 1 :(得分:1)
通过首先清除LANG
环境变量来解决问题:
set LANG=
ruby dk.rb init