无法在ruby 2.2.1中安装json 1.8.3

asf*_*ows 7 ruby gem json bundler

我运行bundle installRuby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux](安装了RVM 33年1月25日)和bundler 1.10.6

当它尝试安装json 1.8.3时,我得到以下内容:

Installing json 1.8.3 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/home/andrew/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20150905-31357-cgs3dn.rb extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling generator.c
linking shared-object json/ext/generator.so

make "DESTDIR=" install
./install -m 0755 generator.so ./.gem.20150905-31357-199esvy/json/ext
make: ./install: Command not found
make: *** [install-so] Error 127

make install failed, exit code 2
Run Code Online (Sandbox Code Playgroud)

在同一台主机上,我可以在ruby 2.1.3中安装json 1.8.3.

另一个SO问题中,我看到了确保install可用的建议.我这样做时输出有效install --help.

我该怎么办?为什么gem能够安装在2.1.3而不是2.2.1中?

小智 13

简单修复删除你的gem.lock文件并运行bundle install这应该重建gemlock文件并解决问题,我在尝试将我的开发环境从nitrous.io移动到cloud9时遇到了同样的错误.希望这个帮助

从migs120的答案https://github.com/flori/json/issues/253复制

我使用macOS sierra,它的工作正常.

  • 谢谢!我发现答案很有帮助。我最终只是在做“捆绑更新 json” (2认同)

shu*_*hra 5

我建议在 MacOS 上尝试这个,

bundle update json --conservative
Run Code Online (Sandbox Code Playgroud)

它将解决该错误。


小智 1

在ubuntu中安装以下包

sudo apt-get install libgmp3-dev

欲了解更多信息 https://github.com/flori/json/issues/253