gpt4 book ai didi

ruby-on-rails - 我收到错误消息 :in `tr' : invalid byte sequence in UTF-8 (ArgumentError) when I run: ruby dk. rb init

转载 作者:太空宇宙 更新时间:2023-11-03 16:07:26 26 4
gpt4 key购买 nike

我已经在我的电脑上安装了 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>'

你们对这个问题有什么建议吗?

最佳答案

我遇到过同样的情况。我认为您可能想要安装 json 库。您应该使用 msys.bat 并在此终端上安装 json

  1. 在 DevKit 目录中执行 msys.bat -> 它会调用一个新终端。
  2. gem install json 在此终端上。
  3. 您可以继续gem install rails

关于ruby-on-rails - 我收到错误消息 :in `tr' : invalid byte sequence in UTF-8 (ArgumentError) when I run: ruby dk. rb init,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10576631/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com