An error occurred while installing json and bundler cannot continue



Как решить проблему ruby с установкой nio4r и json?

Решил на днях опробовать chef вот по этому туториалу Getting Started with Chef Server. Part 1

Но на этапе bundlа Gemfile-а столкнулся вот с такими ошибками:

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

current directory: /usr/share/gems/gems/nio4r-2.5.7/ext/nio4r
/usr/bin/ruby -r ./siteconf20210607-71504-1hvpr6w.rb extconf.rb —with-cflags=-std=c99
checking for unistd.h. *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.

Provided configuration options:
—with-opt-dir
—without-opt-dir
—with-opt-include
—without-opt-include=$/include
—with-opt-lib
—without-opt-lib=$/lib64
—with-make-prog
—without-make-prog
—srcdir=.
—curdir
—ruby=/usr/bin/$(RUBY_BASE_NAME)
/usr/share/ruby/mkmf.rb:456:in `try_do’: The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/share/ruby/mkmf.rb:590:in `try_cpp’
from /usr/share/ruby/mkmf.rb:1098:in `block in have_header’
from /usr/share/ruby/mkmf.rb:948:in `block in checking_for’
from /usr/share/ruby/mkmf.rb:350:in `block (2 levels) in postpone’
from /usr/share/ruby/mkmf.rb:320:in `open’
from /usr/share/ruby/mkmf.rb:350:in `block in postpone’
from /usr/share/ruby/mkmf.rb:320:in `open’
from /usr/share/ruby/mkmf.rb:346:in `postpone’
from /usr/share/ruby/mkmf.rb:947:in `checking_for’
from /usr/share/ruby/mkmf.rb:1097:in `have_header’
from extconf.rb:15:in `’

To see why this extension failed to compile, please check the mkmf.log which can be found here:

extconf failed, exit code 1

Gem files will remain installed in /usr/share/gems/gems/nio4r-2.5.7 for inspection.
Results logged to /usr/lib64/gems/ruby/nio4r-2.5.7/gem_make.out

An error occurred while installing nio4r (2.5.7), and Bundler cannot continue.
Make sure that `gem install nio4r -v ‘2.5.7’ —source ‘rubygems.org’` succeeds before bundling.

In Gemfile:
berkshelf was resolved to 6.1.1, which depends on
berkshelf-api-client was resolved to 3.0.0, which depends on
ridley was resolved to 5.1.1, which depends on
celluloid-io was resolved to 0.16.2, which depends on
nio4r

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

current directory: /usr/share/gems/gems/json-1.7.7/ext/json/ext/generator
/usr/bin/ruby -r ./siteconf20210607-71504-g1ktuv.rb extconf.rb
creating Makefile

current directory: /usr/share/gems/gems/json-1.7.7/ext/json/ext/generator
make «DESTDIR=» clean
sh: make: command not found

current directory: /usr/share/gems/gems/json-1.7.7/ext/json/ext/generator
make «DESTDIR=»
sh: make: command not found

make failed, exit code 127

Gem files will remain installed in /usr/share/gems/gems/json-1.7.7 for inspection.
Results logged to /usr/lib64/gems/ruby/json-1.7.7/gem_make.out

An error occurred while installing json (1.7.7), and Bundler cannot continue.
Make sure that `gem install json -v ‘1.7.7’ —source ‘rubygems.org’` succeeds before bundling.

In Gemfile:
berkshelf was resolved to 6.1.1, which depends on
berkshelf-api-client was resolved to 3.0.0, which depends on
ridley was resolved to 5.1.1, which depends on
json

Если я пытаюсь отдельно дернуть gem install nio4r -v ‘2.5.7’ —source ‘rubygems.org’ и gem install json -v ‘1.7.7’ —source ‘rubygems.org’

Читайте также:  Mixer attach default error

gem install nio4r -v ‘2.5.7’ —source ‘rubygems.org’
Building native extensions. This could take a while.
ERROR: Error installing nio4r:
ERROR: Failed to build gem native extension.

current directory: /usr/local/share/gems/gems/nio4r-2.5.7/ext/nio4r
/usr/bin/ruby -r ./siteconf20210607-71576-1qjn5a4.rb extconf.rb
checking for unistd.h. *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.

Provided configuration options:
—with-opt-dir
—without-opt-dir
—with-opt-include
—without-opt-include=$/include
—with-opt-lib
—without-opt-lib=$/lib64
—with-make-prog
—without-make-prog
—srcdir=.
—curdir
—ruby=/usr/bin/$(RUBY_BASE_NAME)
/usr/share/ruby/mkmf.rb:456:in `try_do’: The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/share/ruby/mkmf.rb:590:in `try_cpp’
from /usr/share/ruby/mkmf.rb:1098:in `block in have_header’
from /usr/share/ruby/mkmf.rb:948:in `block in checking_for’
from /usr/share/ruby/mkmf.rb:350:in `block (2 levels) in postpone’
from /usr/share/ruby/mkmf.rb:320:in `open’
from /usr/share/ruby/mkmf.rb:350:in `block in postpone’
from /usr/share/ruby/mkmf.rb:320:in `open’
from /usr/share/ruby/mkmf.rb:346:in `postpone’
from /usr/share/ruby/mkmf.rb:947:in `checking_for’
from /usr/share/ruby/mkmf.rb:1097:in `have_header’
from extconf.rb:15:in `’

To see why this extension failed to compile, please check the mkmf.log which can be found here:

extconf failed, exit code 1

Gem files will remain installed in /usr/local/share/gems/gems/nio4r-2.5.7 for inspection.
Results logged to /usr/local/lib64/gems/ruby/nio4r-2.5.7/gem_make.out

gem install json -v ‘1.7.7’ —source ‘rubygems.org’
Building native extensions. This could take a while.
ERROR: Error installing json:
ERROR: Failed to build gem native extension.

current directory: /usr/local/share/gems/gems/json-1.7.7/ext/json/ext/generator
/usr/bin/ruby -r ./siteconf20210607-71587-1rd7fwt.rb extconf.rb
creating Makefile

current directory: /usr/local/share/gems/gems/json-1.7.7/ext/json/ext/generator
make «DESTDIR=» clean
sh: make: command not found

current directory: /usr/local/share/gems/gems/json-1.7.7/ext/json/ext/generator
make «DESTDIR=»
sh: make: command not found

make failed, exit code 127

Gem files will remain installed in /usr/local/share/gems/gems/json-1.7.7 for inspection.
Results logged to /usr/local/lib64/gems/ruby/json-1.7.7/gem_make.out

Подскажите, как это победить? В Google для себя решения найти не смог, так как почти везде советуют поставить Devkit b gcc, но мне это не помогло

Источник

An error occurred while installing json (2.1.0), and Bundler cannot continue. #2

Comments

ccorcos commented May 4, 2017

Any ideas? I’m not a Ruby person. :/

The text was updated successfully, but these errors were encountered:

Almouro commented May 11, 2017

There seems to be a solution on this issue, does it fix your problem? 🙂

odeann commented May 14, 2017 •

@ccorcos It happens when you installed fastlane to the

/.fastlane directory (via homebrew or using the official installer). Try to uninstall fastlane first (or delete

Читайте также:  Mozilla pkix error key pinning failure

/.fastlane directory, but anyway, don’t forget to remove export PATH=»$HOME/.fastlane/bin:$PATH» line in

/.bash_profile ) and then install fastlane with gem:

Almouro commented Jul 25, 2017

Hi @ccorcos, did odeann’s answer fix your problem?
I’m closing this issue since there was no activity for a while, but feel free to reopen if it didn’t fix it 🙂

ccorcos commented Jul 25, 2017

I never ended up using fastlane 🙁

Almouro commented Jul 26, 2017

@ccorcos ah out of curiosity, what did you end up using for deployment? 🙂

ccorcos commented Jul 26, 2017

I just archive and upload straight from Xcode.

mdanics commented Aug 2, 2017

@ccorcos @Almouro have the same problem, the solutions didn’t work

odeann commented Sep 10, 2017

@mdanics @ccorcos Just out of curiosity: What does which fastlane says?

wootwoot1234 commented Oct 4, 2017

@Almouro I’m getting this error too. I don’t think this is solved and this issue should be reopened.

Almouro commented Oct 4, 2017

In this issue there is a suggestion by one of the Fastlane owners:

Does it work for you? If it doesn’t can you output which fastlane ?

wootwoot1234 commented Oct 4, 2017 •

@Almouro, thanks for the help.

This is what I got:

and which fastlane returns nothing.

I think I installed fastlane with the following command:

I wonder if it has to do with the install method?

Almouro commented Oct 5, 2017

You’re right, it could have to do with the install method.

And then try your lane?

wootwoot1234 commented Oct 5, 2017 •

Ok, this is what I did and where I’m at now:

I uninstalled fastlane using brew:

removed this line from my ‘

/.bash_profile’ per the instructions in terminal after the uninstall:

I am using rbenv so I set my global ruby to system (otherwise you’ll get errors when using fastlane):

installed fastlane using the following command, as recommended on the fastlane site:

I closed and reopened terminal.

Then I navigated to my project directory.

I installed the plugin:

It installed with no errors and so I ran deploy:

But I get the following error (seems like it’s trying to install it again?):

Источник

Error installing bundle (on json-1.8.1) #4462

Comments

TrySpace commented Apr 24, 2016

I’ve tried multiple reinstalls and suggested fixes. I tried: gem install json -v ‘1.8.1’ , but errors:

Читайте также:  System error 1067 starting service

The text was updated successfully, but these errors were encountered:

b-ggs commented Apr 25, 2016

This issue seems to be similar to this one. May I ask, what suggested fixes have you tried so far?

TrySpace commented Apr 25, 2016 •

Well, I just tried: ‘bundle update’:

and now bundle install finishes without errors:

bretonio commented Nov 2, 2016

bundle update && bundle install worked for me .

mraaroncruz commented Dec 22, 2016

💥 The two solutions above are dangerous

Running bundle update will update all of your dependencies which may solve the problem but cause a host of other ones.

A safer solution would be to run bundle update json which in my case still crashed on kgio .
So I ran bundle update json kgio .
This will only update those two gems and their dependencies. This is a much safer route.

bundle install is not necessary.

Sorry for the thumbs downs but I guess they point to this comment 😛

sayling commented Dec 31, 2016

Further to @pferdefleisch ‘s comment — a single bundle update json was what fixed it for me — so you don’t need to bundle update everything in the universe. Thanks for the solutions, guys!

jb61264 commented Jan 7, 2017

I have been trying these suggestions and still get the error. any suggestions?

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

/usr/local/bin/ruby -r ./siteconf20170107-16179-1uc3h4p.rb extconf.rb
creating Makefile

current directory: /usr/local/lib/ruby/gems/2.4.0/gems/json-1.8.3/ext/json/ext/generator
make «DESTDIR=» clean

current directory: /usr/local/lib/ruby/gems/2.4.0/gems/json-1.8.3/ext/json/ext/generator
make «DESTDIR=»
compiling generator.c
generator.c: In function ‘generate_json’:
generator.c:861:25: error: ‘rb_cFixnum’ undeclared (first use in this function)
> else if (klass == rb_cFixnum) <
^
generator.c:861:25: note: each undeclared identifier is reported only once for each function it appears in
generator.c:863:25: error: ‘rb_cBignum’ undeclared (first use in this function)
> else if (klass == rb_cBignum) <
^
generator.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-self-assign’
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
cc1: warning: unrecognized command line option ‘-Wno-tautological-compare’
Makefile:241: recipe for target ‘generator.o’ failed
make: *** [generator.o] Error 1

make failed, exit code 2

Gem files will remain installed in /usr/local/lib/ruby/gems/2.4.0/gems/json-1.8.3 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.4.0/extensions/x86_64-linux/2.4.0-static/json-1.8.3/gem_make.out

An error occurred while installing json (1.8.3), and Bundler cannot continue.
Make sure that gem install json -v ‘1.8.3’ succeeds before bundling.

Источник

Оцените статью
toolgir.ru
Adblock
detector