ruby / psych

A libyaml wrapper for Ruby
MIT License
566 stars 205 forks source link

Issue between psych and mini_racer on platform x86_64-linux #657

Closed jplanza closed 11 months ago

jplanza commented 1 year ago

Hello folks. I'm pretty new to Ruby but I thought this might be interesting for someone with more knowledge to look into. To keep this short, I installed the debug gem on MacOS to solve an unrelated runtime problem. I sorted everything out locally and had a working bundle there, so the next step was to go back to a Docker container; except the builds started failing in Linux. It turns out that debug has psych in its dependency chain and will build fine on Darwin but not Linux.

I was able to workaround this by removing the debugger, so I don't actually need any help here. But I'm offering this up in case someone can make better sense of it and perhaps solve it for the next person using this gem. Please let me know if you need any further information about my build environment.

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

    current directory: /usr/local/bundle/gems/mini_racer-0.6.4/ext/mini_racer_extension
/usr/local/bin/ruby -I /usr/local/lib/ruby/2.7.0 -r ./siteconf20231013-2120-196jb7m.rb extconf.rb
checking for -lpthread... yes
*** 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=/usr/local/bin/$(RUBY_BASE_NAME)
    --with-pthread-dir
    --without-pthread-dir
    --with-pthread-include
    --without-pthread-include=${pthread-dir}/include
    --with-pthread-lib
    --without-pthread-lib=${pthread-dir}/lib
    --with-pthreadlib
    --without-pthreadlib
    --enable-debug
    --disable-debug
    --enable-asan
    --disable-asan
/usr/local/lib/ruby/2.7.0/psych.rb:456:in `parse_stream': undefined method `parse' for #<Psych::Parser:0x0000557915abd158> (NoMethodError)
    from /usr/local/lib/ruby/2.7.0/psych.rb:390:in `parse'
    from /usr/local/lib/ruby/2.7.0/psych.rb:277:in `load'
    from /usr/local/bundle/gems/libv8-node-16.19.0.1-x86_64-linux/ext/libv8-node/location.rb:21:in `block in load!'
    from /usr/local/bundle/gems/libv8-node-16.19.0.1-x86_64-linux/ext/libv8-node/location.rb:20:in `open'
    from /usr/local/bundle/gems/libv8-node-16.19.0.1-x86_64-linux/ext/libv8-node/location.rb:20:in `load!'
    from /usr/local/bundle/gems/libv8-node-16.19.0.1-x86_64-linux/lib/libv8/node.rb:8:in `configure_makefile'
    from extconf.rb:77:in `<main>'

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

  /usr/local/bundle/extensions/x86_64-linux/2.7.0/mini_racer-0.6.4/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /usr/local/bundle/gems/mini_racer-0.6.4 for inspection.
Results logged to /usr/local/bundle/extensions/x86_64-linux/2.7.0/mini_racer-0.6.4/gem_make.out

  /usr/local/lib/ruby/2.7.0/rubygems/ext/builder.rb:99:in `run'
  /usr/local/lib/ruby/2.7.0/rubygems/ext/ext_conf_builder.rb:48:in `block in build'
  /usr/local/lib/ruby/2.7.0/tempfile.rb:291:in `open'
  /usr/local/lib/ruby/2.7.0/rubygems/ext/ext_conf_builder.rb:30:in `build'
  /usr/local/lib/ruby/2.7.0/rubygems/ext/builder.rb:169:in `block in build_extension'
  /usr/local/lib/ruby/2.7.0/rubygems/ext/builder.rb:165:in `synchronize'
  /usr/local/lib/ruby/2.7.0/rubygems/ext/builder.rb:165:in `build_extension'
  /usr/local/lib/ruby/2.7.0/rubygems/ext/builder.rb:210:in `block in build_extensions'
  /usr/local/lib/ruby/2.7.0/rubygems/ext/builder.rb:207:in `each'
  /usr/local/lib/ruby/2.7.0/rubygems/ext/builder.rb:207:in `build_extensions'
  /usr/local/lib/ruby/2.7.0/rubygems/installer.rb:844:in `build_extensions'
  /usr/local/bundle/gems/bundler-2.4.10/lib/bundler/rubygems_gem_installer.rb:72:in `build_extensions'
  /usr/local/bundle/gems/bundler-2.4.10/lib/bundler/rubygems_gem_installer.rb:28:in `install'
  /usr/local/bundle/gems/bundler-2.4.10/lib/bundler/source/rubygems.rb:200:in `install'
  /usr/local/bundle/gems/bundler-2.4.10/lib/bundler/installer/gem_installer.rb:54:in `install'
  /usr/local/bundle/gems/bundler-2.4.10/lib/bundler/installer/gem_installer.rb:16:in `install_from_spec'
  /usr/local/bundle/gems/bundler-2.4.10/lib/bundler/installer/parallel_installer.rb:156:in `do_install'
  /usr/local/bundle/gems/bundler-2.4.10/lib/bundler/installer/parallel_installer.rb:147:in `block in worker_pool'
  /usr/local/bundle/gems/bundler-2.4.10/lib/bundler/worker.rb:62:in `apply_func'
  /usr/local/bundle/gems/bundler-2.4.10/lib/bundler/worker.rb:57:in `block in process_queue'
  /usr/local/bundle/gems/bundler-2.4.10/lib/bundler/worker.rb:54:in `loop'
  /usr/local/bundle/gems/bundler-2.4.10/lib/bundler/worker.rb:54:in `process_queue'
  /usr/local/bundle/gems/bundler-2.4.10/lib/bundler/worker.rb:90:in `block (2 levels) in create_threads'

An error occurred while installing mini_racer (0.6.4), and Bundler cannot continue.

In Gemfile:
  mini_racer
n00dle commented 1 year ago

This was fixed in rubygems: https://github.com/rubygems/rubygems/issues/6611

You can update your rubygems with gem update --system