Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error installing json #319

Closed
willybc opened this issue Mar 7, 2017 · 7 comments
Closed

Error installing json #319

willybc opened this issue Mar 7, 2017 · 7 comments

Comments

@willybc
Copy link

willybc commented Mar 7, 2017

`$ gem install json -v 1.8

ERROR: Error installing json:
ERROR: Failed to build gem native extension.

current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/json-1.8.0/ext/json/ext/generator

C:/Ruby23-x64/bin/ruby.exe -r ./siteconf20170307-8672-16qswbm.rb extconf.rb
creating Makefile

current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/json-1.8.0/ext/json/ext/generator
make "DESTDIR=" clean
"make" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.

current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/json-1.8.0/ext/json/ext/generator
make "DESTDIR="
"make" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.

make failed, exit code 1

Gem files will remain installed in C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/json-1.8.0 for inspection.
Results logged to C:/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/json-1.8.0/gem_make.out
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...

`

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

current directory:
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/json-1.8.6/ext/json/ext/generator
C:/Ruby23-x64/bin/ruby.exe -r ./siteconf20170307-13780-pxrhll.rb extconf.rb
creating Makefile

current directory:
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/json-1.8.6/ext/json/ext/generator
make "DESTDIR=" clean
"make" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.

current directory:
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/json-1.8.6/ext/json/ext/generator
make "DESTDIR="
"make" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.

make failed, exit code 1

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

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

`

@djangofan
Copy link

djangofan commented Mar 17, 2017

I'm having almost the same error. I'm on Windows10. I installed Ruby 2.3.3 using Scoop. My Gemfile includes these items:

gem 'httparty'
gem 'rspec'
gem 'cucumber', '>=2.4.0'
gem 'rake'
gem 'json', '~> 1.8.6'
gem 'parallel_cucumber'
gem 'report_builder'

And my error looks like thsi:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
/scoop/apps/ruby/current/lib/ruby/gems/2.3.0/gems/json-1.8.6/ext/json/ext/generator
/scoop/apps/ruby/current/bin/ruby.exe -r
./siteconf20170316-5624-zskt8x.rb extconf.rb
creating Makefile
extconf failed, exit code 1
Gem files will remain installed in
/scoop/apps/ruby/current/lib/ruby/gems/2.3.0/gems/json-1.8.6
for inspection.
Results logged to
/scoop/apps/ruby/current/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/json-1.8.6/gem_make.out
An error occurred while installing json (1.8.6), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.6'` succeeds before bundling.

@testwts
Copy link

testwts commented Apr 4, 2017

I'm getting same problem with below error

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

current directory: /home/user/.rvm/gems/ruby-2.2.2/gems/json-1.8.1/ext/json/ext/generator

/home/user/.rvm/rubies/ruby-2.2.2/bin/ruby -r ./siteconf20170404-3765-1oh8j0o.rb extconf.rb
creating Makefile

current directory: /home/user/.rvm/gems/ruby-2.2.2/gems/json-1.8.1/ext/json/ext/generator
make "DESTDIR=" clean

current directory: /home/user/.rvm/gems/ruby-2.2.2/gems/json-1.8.1/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
In file included from generator.c:1:0:
../fbuffer/fbuffer.h: In function ‘fbuffer_to_s’:
../fbuffer/fbuffer.h:175:47: error: macro "rb_str_new" requires 2 arguments, but only 1 given
VALUE result = rb_str_new(FBUFFER_PAIR(fb));
^
../fbuffer/fbuffer.h:175:20: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
VALUE result = rb_str_new(FBUFFER_PAIR(fb));
^
Makefile:237: recipe for target 'generator.o' failed
make: *** [generator.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/user/.rvm/gems/ruby-2.2.2/gems/json-1.8.1 for inspection.
Results logged to /home/user/.rvm/gems/ruby-2.2.2/extensions/x86_64-linux/2.2.0/json-1.8.1/gem_make.out

@tapickell
Copy link

tapickell commented Apr 11, 2017

On Linux Mint, this builds fine on OSX

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

    current directory: /home/pklx/.rvm/gems/ruby-2.4.0/gems/json-1.8.3/ext/json/ext/generator
/home/pklx/.rvm/rubies/ruby-2.4.0/bin/ruby -r ./siteconf20170410-302-ayxtjd.rb extconf.rb
creating Makefile

current directory: /home/pklx/.rvm/gems/ruby-2.4.0/gems/json-1.8.3/ext/json/ext/generator
make "DESTDIR=" clean

current directory: /home/pklx/.rvm/gems/ruby-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 /home/pklx/.rvm/gems/ruby-2.4.0/gems/json-1.8.3 for inspection.
Results logged to /home/pklx/.rvm/gems/ruby-2.4.0/extensions/x86_64-linux/2.4.0/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.

@MSP-Greg
Copy link
Contributor

@willybc @djangofan @testwts

The gem will install with RubyInstaller2 (or similar) builds. Appveyor results here.

I believe the ragel package needs to be installed, which may not be available with the older RubyInstaller build system.

@chaonan99
Copy link

Is there a workaround to this problem? My problem is the same @tapickell .

@chaonan99
Copy link

Ok, I see in #303 issue that as I'm using ruby 2.4, json 1.8 is not compatible. So I just run gem install json and the problem goes away.

@flori flori closed this as completed Dec 21, 2017
@MeetChavda
Copy link

Still not working, try this...

$ bundle update json
$ bundle install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants