首页 > 解决方案 > 捆绑安装 Json 错误

问题描述

我的 ruby​​ 环境已经设置好了。我可以通过命令行检索我的 Gherkins 语法并运行简单的 ruby​​ 网络测试。但我需要一些其他的宝石来完成环境。我需要做的就是让 bundle install 工作,但不知道为什么它没有安装。我也更新了我的宝石。我在 Windows 10 上使用 Ruby 2.2.3。下面是我尝试运行后的输出。

C:\GitHubFiles\MyAccountWeb-Tests>bundle install
Fetching gem metadata from http://rubygems.org/............
Resolving dependencies...
Using public_suffix 3.0.2
Using addressable 2.5.2
Using awesome_print 1.8.0
Installing json 2.1.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    C:/Ruby22-x64/bin/ruby.exe -r ./siteconf20180817-13500-1p562oy.rb extconf.rb                                                       creating Makefile

make "DESTDIR=" clean
                                                                                                                                       make "DESTDIR="

make failed, uncaught signal 11
Gem files will remain installed in
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/json-2.1.0 for inspection.
Results logged to
C:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0/json-2.1.0/gem_make.out

An error occurred while installing json (2.1.0), and Bundler cannot
continue.
Make sure that `gem install json -v '2.1.0' --source 'http://rubygems.org/'`
succeeds before bundling.
                                                                                                                                       In Gemfile:
  appium_lib was resolved to 9.7.1, which depends on
    json

我的来源已经设置为“ http://rubygems.org/ ”。我运行了“gem sources -r https://rubygems.org -a http://rubygems.org ”来确认这一点。尝试运行 'gem install json -v '2.1.0' 后的输出如下。

C:\GitHubFiles\MyAccountWeb-Tests>gem install json -v '2.1.0'
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR:  Error installing json:
        ERROR: Failed to build gem native extension.

    current directory: C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/json-2.1.0/ext/json/ext/generator
C:/Ruby22-x64/bin/ruby.exe -r ./siteconf20180817-15312-13stnps.rb extconf.rb
creating Makefile

current directory: C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/json-2.1.0/ext/json/ext/generator
make "DESTDIR=" clean

current directory: C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/json-2.1.0/ext/json/ext/generator
make "DESTDIR="

make failed, uncaught signal 11

Gem files will remain installed in C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/json-2.1.0 for inspection.
Results logged to C:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0/json-2.1.0/gem_make.out

gem_make 文本文件

current directory: C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/json-2.1.0/ext/json/ext/generator
C:/Ruby22-x64/bin/ruby.exe -r ./siteconf20180817-10044-ypvx4a.rb extconf.rb
creating Makefile

current directory: C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/json-2.1.0/ext/json/ext/generator
make "DESTDIR=" clean

current directory: C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/json-2.1.0/ext/json/ext/generator
make "DESTDIR="

make failed, uncaught signal 11

根据此链接,我应该尝试 rake install。https://www.rubydoc.info/gems/json/2.1.0。但它只是说 rake 中止了。未找到 rake 文件。

我还尝试了'gem install bundler -v'= 1.5.1'',然后是'bundle package',这会产生相同的 json 错误。

我已经尝试过捆绑更新和捆绑更新 json。

我读到json版本1.8.1和ruby 2.2.3有问题,所以安装json 1.8.3版本,所以我尝试了gem install json -v1.8.3。相同的json错误。

我尝试删除我的 gemfile 并再次运行 bundle update,它替换了 gemfile 并再次创建了 bundle install 错误:(

我被困住了!

标签: jsonrubybundler

解决方案


推荐阅读