无法在ruby 2.2.1中安装json 1.8.3

时间:2023-01-04 00:18:11

I am running bundle install in Ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux] (installed with rvm 1.25.33) and bundler 1.10.6

我在Ruby 2.2.1p85(2015-02-26修订版49769)[x86_64-linux](安装rvm 1.25.33)和bundler 1.10.6中运行bundle install

When it tries to install json 1.8.3, I get the following:

当它尝试安装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

On the same host, I am able to install json 1.8.3 in ruby 2.1.3.

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

In another SO question I see the suggestion to make sure that install is available. I get valid output when I do install --help.

在另一个SO问题中,我看到了确保安装可用的建议。当我安装--help时,我得到有效的输出。

What should I do? Why is the gem able to install in 2.1.3 and not 2.2.1?

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

3 个解决方案

#1


12  

simple fix delete your gem.lock file and run bundle install this should rebuild the gemlock file and fix the issue, i was getting the same error when trying to move my development environment from nitrous.io to cloud9,. hope this help

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

copy from migs120's answer https://github.com/flori/json/issues/253

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

I use macOS sierra, it's work fine.

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

#2


1  

Install the following package in ubuntu

在ubuntu中安装以下软件包

sudo apt-get install libgmp3-dev

sudo apt-get install libgmp3-dev

For more information https://github.com/flori/json/issues/253

有关更多信息,请访问https://github.com/flori/json/issues/253

#3


1  

In OSX, do the following

在OSX中,执行以下操作

brew install coreutils

#1


12  

simple fix delete your gem.lock file and run bundle install this should rebuild the gemlock file and fix the issue, i was getting the same error when trying to move my development environment from nitrous.io to cloud9,. hope this help

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

copy from migs120's answer https://github.com/flori/json/issues/253

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

I use macOS sierra, it's work fine.

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

#2


1  

Install the following package in ubuntu

在ubuntu中安装以下软件包

sudo apt-get install libgmp3-dev

sudo apt-get install libgmp3-dev

For more information https://github.com/flori/json/issues/253

有关更多信息,请访问https://github.com/flori/json/issues/253

#3


1  

In OSX, do the following

在OSX中,执行以下操作

brew install coreutils