ohler55 / oj

Optimized JSON
http://www.ohler.com/oj
MIT License
3.16k stars 252 forks source link

Error installing gem for jruby #607

Closed yashwinkumar closed 4 years ago

yashwinkumar commented 4 years ago

Getting the following issue while installing oj gem for JRuby version jruby-9.1.17.0

0:  lru_redux (1.1.0) from /Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/specifications/lru_redux-1.1.0.gemspec
Fetching oj 3.10.6
Installing oj 3.10.6 with native extensions
Building native extensions.  This could take a while...
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/oj-3.10.6/ext/oj
/Users/ashwin.ky/.rvm/rubies/jruby-9.1.17.0/bin/jruby -r
./siteconf20200710-5213-1x9g1uo.rb extconf.rb
>>>>> Creating Makefile for jruby version 2.3.3 on java <<<<<
checking for rb_time_timespec()... RuntimeError: The compiler failed to generate
an executable file.
You have to install development tools first.

try_do at
/Users/ashwin.ky/.rvm/rubies/jruby-9.1.17.0/lib/ruby/stdlib/mkmf.rb:456
try_link0 at
/Users/ashwin.ky/.rvm/rubies/jruby-9.1.17.0/lib/ruby/stdlib/mkmf.rb:541
try_link at
/Users/ashwin.ky/.rvm/rubies/jruby-9.1.17.0/lib/ruby/stdlib/mkmf.rb:556
try_func at
/Users/ashwin.ky/.rvm/rubies/jruby-9.1.17.0/lib/ruby/stdlib/mkmf.rb:765
block in have_func at
/Users/ashwin.ky/.rvm/rubies/jruby-9.1.17.0/lib/ruby/stdlib/mkmf.rb:1051
block in checking_for at
/Users/ashwin.ky/.rvm/rubies/jruby-9.1.17.0/lib/ruby/stdlib/mkmf.rb:942
block in postpone at
/Users/ashwin.ky/.rvm/rubies/jruby-9.1.17.0/lib/ruby/stdlib/mkmf.rb:350
open at
/Users/ashwin.ky/.rvm/rubies/jruby-9.1.17.0/lib/ruby/stdlib/mkmf.rb:320
block in postpone at
/Users/ashwin.ky/.rvm/rubies/jruby-9.1.17.0/lib/ruby/stdlib/mkmf.rb:350
open at
/Users/ashwin.ky/.rvm/rubies/jruby-9.1.17.0/lib/ruby/stdlib/mkmf.rb:320
postpone at
/Users/ashwin.ky/.rvm/rubies/jruby-9.1.17.0/lib/ruby/stdlib/mkmf.rb:346
checking_for at
/Users/ashwin.ky/.rvm/rubies/jruby-9.1.17.0/lib/ruby/stdlib/mkmf.rb:941
have_func at
/Users/ashwin.ky/.rvm/rubies/jruby-9.1.17.0/lib/ruby/stdlib/mkmf.rb:1050
                 <main> at extconf.rb:26
*** 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=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/Users/ashwin.ky/.rvm/rubies/jruby-9.1.17.0/bin/jruby
    --with-oj-dir
    --without-oj-dir
    --with-oj-include
    --without-oj-include=${oj-dir}/include
    --with-oj-lib
    --without-oj-lib=${oj-dir}/lib

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

/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/extensions/universal-java-1.8/2.3.0/oj-3.10.6/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/oj-3.10.6 for inspection.
Results logged to
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/extensions/universal-java-1.8/2.3.0/oj-3.10.6/gem_make.out

/Users/ashwin.ky/.rvm/rubies/jruby-9.1.17.0/lib/ruby/stdlib/rubygems/ext/builder.rb:92:in
`run'
/Users/ashwin.ky/.rvm/rubies/jruby-9.1.17.0/lib/ruby/stdlib/rubygems/ext/ext_conf_builder.rb:48:in
`block in build'
  org/jruby/RubyIO.java:1171:in `open'
/Users/ashwin.ky/.rvm/rubies/jruby-9.1.17.0/lib/ruby/stdlib/rubygems/ext/ext_conf_builder.rb:31:in
`build'
/Users/ashwin.ky/.rvm/rubies/jruby-9.1.17.0/lib/ruby/stdlib/rubygems/ext/builder.rb:164:in
`block in build_extension'
  org/jruby/RubyDir.java:323:in `chdir'
/Users/ashwin.ky/.rvm/rubies/jruby-9.1.17.0/lib/ruby/stdlib/rubygems/ext/builder.rb:163:in
`block in build_extension'
/Users/ashwin.ky/.rvm/rubies/jruby-9.1.17.0/lib/ruby/stdlib/monitor.rb:214:in
`mon_synchronize'
/Users/ashwin.ky/.rvm/rubies/jruby-9.1.17.0/lib/ruby/stdlib/rubygems/ext/builder.rb:162:in
`build_extension'
/Users/ashwin.ky/.rvm/rubies/jruby-9.1.17.0/lib/ruby/stdlib/rubygems/ext/builder.rb:201:in
`block in build_extensions'
  org/jruby/RubyArray.java:1735:in `each'
/Users/ashwin.ky/.rvm/rubies/jruby-9.1.17.0/lib/ruby/stdlib/rubygems/ext/builder.rb:198:in
`build_extensions'
/Users/ashwin.ky/.rvm/rubies/jruby-9.1.17.0/lib/ruby/stdlib/rubygems/installer.rb:764:in
`build_extensions'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/lib/bundler/rubygems_gem_installer.rb:30:in
`build_extensions'
/Users/ashwin.ky/.rvm/rubies/jruby-9.1.17.0/lib/ruby/stdlib/rubygems/installer.rb:304:in
`install'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/lib/bundler/source/rubygems.rb:145:in
`block in install'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/lib/bundler/rubygems_integration.rb:221:in
`preserve_paths'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/lib/bundler/source/rubygems.rb:144:in
`install'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/lib/bundler/installer/gem_installer.rb:63:in
`install'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/lib/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/lib/bundler/installer/parallel_installer.rb:164:in
`do_install'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/lib/bundler/installer/parallel_installer.rb:148:in
`install_serially'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/lib/bundler/installer/parallel_installer.rb:103:in
`call'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/lib/bundler/installer/parallel_installer.rb:78:in
`call'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/lib/bundler/installer.rb:289:in
`install_in_parallel'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/lib/bundler/installer.rb:197:in
`install'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/lib/bundler/installer.rb:92:in
`block in run'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/lib/bundler/process_lock.rb:12:in
`block in lock'
  org/jruby/RubyIO.java:1171:in `open'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/lib/bundler/process_lock.rb:9:in
`lock'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/lib/bundler/installer.rb:73:in
`run'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/lib/bundler/installer.rb:25:in
`install'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/lib/bundler/cli/install.rb:65:in
`run'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/lib/bundler/cli.rb:235:in
`block in install'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/lib/bundler/settings.rb:143:in
`temporary'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/lib/bundler/cli.rb:234:in
`install'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in
`run'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in
`invoke_command'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor.rb:387:in
`dispatch'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/lib/bundler/cli.rb:27:in
`dispatch'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/base.rb:466:in
`start'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/lib/bundler/cli.rb:18:in
`start'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/exe/bundle:30:in
`block in (root)'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/lib/bundler/friendly_errors.rb:124:in
`with_friendly_errors'
/Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.17.3/exe/bundle:22:in
`<main>'
  org/jruby/RubyKernel.java:974:in `load'
  /Users/ashwin.ky/.rvm/gems/jruby-9.1.17.0/bin/bundle:23:in `<main>'

An error occurred while installing oj (3.10.6), and Bundler cannot
continue.
Make sure that `gem install oj -v '3.10.6' --source
'http://10.10.0.0/artifactory/v1.0/artifacts/ruby/'` succeeds before
bundling.

In Gemfile:
  sc-auth was resolved to 3.0.1, which depends on
    config-service-client was resolved to 0.1.7, which depends on
      oj
ohler55 commented 4 years ago

JRuby does not support C extension. They stopped supporting C extension many years ago.

yashwinkumar commented 4 years ago

@ohler55 The Jruby is the recent version on which oj is getting installed. Please let me know what needs to do to let the oj install

ohler55 commented 4 years ago

There is nothing that can be done to install Oj on JRuby. JRuby stopped supporting C extensions years ago.

ohler55 commented 4 years ago

Closing, duplicate and this is not a Java gem.