【问题标题】:Ruby `json` gem does not compileRuby `json` gem 无法编译
【发布时间】:2015-06-18 02:06:50
【问题描述】:

我正在尝试让 Rails 在 Windows 系统上运行。我安装了 RubyInstaller 和 Devkit,但我似乎无法安装 json gem。当我尝试gem install json 时,我得到:

Building native extensions.  This could take a while...
ERROR:  Error installing json:
        ERROR: Failed to build gem native extension.

        C:/Ruby193/bin/ruby.exe extconf.rb
creating Makefile

make
generating generator-i386-mingw32.def
compiling generator.c
generator.c:1:0: error: CPU you selected does not support x86-64 instruction set
generator.c:1:0: error: CPU you selected does not support x86-64 instruction set
make: *** [generator.o] Error 1


Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/json-1.8.3 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/json-1.8.3/ext/json/ext/generator/gem_make.out

可能是我的 Ruby 版本(我有 2.2 和 1.9),但我不知道。怎么回事?

【问题讨论】:

  • 嗨,如果你用谷歌搜索特定的错误消息“错误:无法构建 gem 原生扩展。”你会发现这个问题之前已经回答过了。我已经投票赞成关闭您可以尝试的更明显的候选人。
  • 我在 Google 上搜索了 generator.c:1:0: error: CPU you selected does not support x86-64 instruction set 并没有得到任何有用的信息,你确定这些是同一个问题吗?
  • 另外,所有答案似乎都适用于 Linux / Ubuntu 系统
  • 嘿,你能发布你正在使用的 DevKit 的版本吗?看起来它对我来说可能是一个不匹配的 DevKit。

标签: ruby-on-rails ruby json windows gem


【解决方案1】:

@Azolo 发表评论后,我发现我使用的 DevKit 版本与我运行的 Ruby 版本不匹配。问题出现是因为我需要 Ruby 1.9.3 在 Heroku 客户端运行的路径上,但尝试使用 2.2 DevKit(因为我通常使用 Ruby 2.2 进行开发。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-12-19
    • 1970-01-01
    • 1970-01-01
    • 2012-04-23
    • 2013-01-13
    • 2013-01-16
    • 2022-01-21
    • 1970-01-01
    相关资源
    最近更新 更多