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

Support for Psych 5 #437

Closed
dorianmariecom opened this issue Dec 5, 2022 · 11 comments
Closed

Support for Psych 5 #437

dorianmariecom opened this issue Dec 5, 2022 · 11 comments

Comments

@dorianmariecom
Copy link

I'm getting this output when upgrading psych from 4 to 5:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
494 |  
495 | current directory: /usr/local/bundle/gems/skylight-5.3.4/ext
496 | /usr/local/bin/ruby -I /usr/local/lib/ruby/3.1.0 -r
497 | ./siteconf20221205-17-o7zxoa.rb extconf.rb
498 | musl libc (x86_64)
499 | Version 1.2.3
500 | Dynamic Program Loader
501 | Usage: /lib/ld-musl-x86_64.so.1 [options] [--] pathname
502 | *** extconf.rb failed ***
503 | Could not create Makefile due to some reason, probably lack of necessary
504 | libraries and/or headers.  Check the mkmf.log file for more details.  You may
505 | need configuration options.
506 |  
507 | Provided configuration options:
508 | --with-opt-dir
509 | --without-opt-dir
510 | --with-opt-include
511 | --without-opt-include=${opt-dir}/include
512 | --with-opt-lib
513 | --without-opt-lib=${opt-dir}/lib
514 | --with-make-prog
515 | --without-make-prog
516 | --srcdir=.
517 | --curdir
518 | --ruby=/usr/local/bin/$(RUBY_BASE_NAME)
519 | /usr/local/lib/ruby/3.1.0/psych.rb:455:in `parse_stream': undefined method
520 | `parse' for #<Psych::Parser:0x00007f870c732950
521 | @handler=#<Psych::Handlers::DocumentStream:0x00007f870c732b58 @stack=[],
522 | @last=nil, @root=nil, @start_line=nil, @start_column=nil, @end_line=nil,
523 | @end_column=nil, @block=#<Proc:0x00007f870c7329c8
524 | /usr/local/lib/ruby/3.1.0/psych.rb:399>>, @external_encoding=0> (NoMethodError)
525 |  
526 | parser.parse yaml, filename
527 | ^^^^^^
528 | from /usr/local/lib/ruby/3.1.0/psych.rb:399:in `parse'
529 | from /usr/local/lib/ruby/3.1.0/psych.rb:324:in `safe_load'
530 | from /usr/local/lib/ruby/3.1.0/psych.rb:370:in `load'
531 | from /usr/local/lib/ruby/3.1.0/psych.rb:671:in `block in load_file'
532 | from /usr/local/lib/ruby/3.1.0/psych.rb:670:in `open'
533 | from /usr/local/lib/ruby/3.1.0/psych.rb:670:in `load_file'
534 | from extconf.rb:121:in `<main>'
535 | I, [2022-12-05T09:14:41.592907 #3150]  INFO -- :
536 | SKYLIGHT_HDR_PATH=/usr/local/bundle/gems/skylight-5.3.4/ext;
537 | SKYLIGHT_LIB_PATH=/usr/local/bundle/gems/skylight-5.3.4/lib/skylight/native/x86_64-linux-musl
538
@zvkemp
Copy link
Contributor

zvkemp commented Dec 7, 2022

Hi @dorianmariefr!

I don't believe this is an issue with either Skylight nor Psych 5 (your backtrace appears to be pointing to the vendored Psych for ruby 3.1, which is v4). Parser#parse is a natively-implemented function, so I'm guessing something went wrong when Psych was compiled when you installed ruby, and the mostly likely issue is a missing libyaml (or yaml-dev, or your operating system's equivalent).

Ruby should load psych from a gem if it is installed; if it's only in your Gemfile it may not have been installed yet when Skylight's extconf.rb ran. Try a gem install psych -v 5.0.0 (noting any errors about missing native libs) first and bundle again.

@dorianmariecom
Copy link
Author

@zvkemp The build and the tests work fine before upgrading to psych 5.

I have libyaml-dev installed (it was generating a yaml.h not found error before)

I set up a debugging session on GitHub Actions and was able to successfully install psych 5

$ sudo gem install psych
Building native extensions. This could take a while...
Successfully installed psych-5.0.1
Parsing documentation for psych-5.0.1
Installing ri documentation for psych-5.0.1
Done installing documentation for psych after 1 seconds
1 gem installed

I was also able to successfully install skylight with sudo gem install skylight.

But when I installed ruby with rvm, and I do a bundle or gem install skylight I get:

current directory: /home/runner/.rvm/gems/ruby-3.1.2/gems/skylight-5.3.4/ext
/home/runner/.rvm/rubies/ruby-3.1.2/bin/ruby -I /home/runner/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0 -r ./siteconf20221209-18715-82d0sn.rb extconf.rb
*** 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=/home/runner/.rvm/rubies/ruby-3.1.2/bin/$(RUBY_BASE_NAME)
/home/runner/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/psych.rb:455:in `parse_stream': undefined method `parse' for #<Psych::Parser:0x00007f01e5023c38 @handler=#<Psych::Handlers::DocumentStream:0x00007f01e5023da0 @stack=[], @last=nil, @root=nil, @start_line=nil, @start_column=nil, @end_line=nil, @end_column=nil, @block=#<Proc:0x00007f01e5023cb0 /home/runner/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/psych.rb:399>>, @external_encoding=0> (NoMethodError)

      parser.parse yaml, filename
            ^^^^^^
        from /home/runner/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/psych.rb:399:in `parse'
        from /home/runner/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/psych.rb:324:in `safe_load'
        from /home/runner/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/psych.rb:370:in `load'
        from /home/runner/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/psych.rb:671:in `block in load_file'
        from /home/runner/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/psych.rb:670:in `open'
        from /home/runner/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/psych.rb:670:in `load_file'
        from extconf.rb:121:in `<main>'
I, [2022-12-09T07:07:04.525750 #18724]  INFO -- : SKYLIGHT_HDR_PATH=/home/runner/.rvm/gems/ruby-3.1.2/gems/skylight-5.3.4/ext; SKYLIGHT_LIB_PATH=/home/runner/.rvm/gems/ruby-3.1.2/gems/skylight-5.3.4/lib/skylight/native/x86_64-linux

extconf failed, exit code 1

I tried removing psych from our Gemfile, removing the < 6 version constraint, upgrading to psych 5.0.1, moving gem "psych" to the top of the Gemfile, but nothing worked

@zvkemp
Copy link
Contributor

zvkemp commented Dec 13, 2022

The issue must be related to bundler not running with your Gemfile context, but so far I am unable to reproduce the issue. The error arises in a public method in /home/runner/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/psych.rb:399; if you installed libyaml after installing ruby, I suggest you remove Ruby 3.1.2 and re-install it.

If you have a Dockerfile or another way to reproduce the error, I would be happy to take a look, but since this isn't really a Skylight issue (we're only calling public methods on built-in Ruby classes), there's nothing for us to fix here.

@zvkemp zvkemp closed this as completed Jan 7, 2023
@dorianmariecom
Copy link
Author

We didn't figure it out, we solved this by removing psych from our explicit dependencies as it's not needed by our app

@krainboltgreene
Copy link

So this exact error happens in my app (Rails 7.0, Skylight 5.3). I'm using the main branch of rails' Dockerfile which is has a FROM of ruby:3.1.2.20-slim.

I am installing the libyaml-dev from aptitude, so I don't think it's that.

@shanlalit
Copy link

shanlalit commented Sep 10, 2023

IMO this ticket on ruby core might shad some light on the root cause. If you have both Psych 4 and 5 this issues appears. After reading this ticket I have removed Psych 5, now bundle is not giving any errors and Skylight is installed correctly.

https://ml.ruby-lang.org/mailman3/hyperkitty/list/ruby-core@ml.ruby-lang.org/thread/MX4LNG2YYMEMREMW4I7VV2FQFD5GGEZT/

@kg-currenxie
Copy link

kg-currenxie commented Nov 11, 2023

Same issue here.

Gemfile.lock

GIT
  remote: https://github.com/bullet-train-co/magic_test.git
  revision: 0242eadd9bed7e789f3e0a3210b98ac71b78a063
  tag: v0.1.0
  specs:
    magic_test (0.1.0)
      capybara (>= 3.0)
      pry
      pry-stack_explorer
      rails (>= 5.0)

GEM
  remote: https://rubygems.org/
  specs:
    actioncable (7.1.0)
      actionpack (= 7.1.0)
      activesupport (= 7.1.0)
      nio4r (~> 2.0)
      websocket-driver (>= 0.6.1)
      zeitwerk (~> 2.6)
    actionmailbox (7.1.0)
      actionpack (= 7.1.0)
      activejob (= 7.1.0)
      activerecord (= 7.1.0)
      activestorage (= 7.1.0)
      activesupport (= 7.1.0)
      mail (>= 2.7.1)
      net-imap
      net-pop
      net-smtp
    actionmailer (7.1.0)
      actionpack (= 7.1.0)
      actionview (= 7.1.0)
      activejob (= 7.1.0)
      activesupport (= 7.1.0)
      mail (~> 2.5, >= 2.5.4)
      net-imap
      net-pop
      net-smtp
      rails-dom-testing (~> 2.2)
    actionpack (7.1.0)
      actionview (= 7.1.0)
      activesupport (= 7.1.0)
      nokogiri (>= 1.8.5)
      rack (>= 2.2.4)
      rack-session (>= 1.0.1)
      rack-test (>= 0.6.3)
      rails-dom-testing (~> 2.2)
      rails-html-sanitizer (~> 1.6)
    actiontext (7.1.0)
      actionpack (= 7.1.0)
      activerecord (= 7.1.0)
      activestorage (= 7.1.0)
      activesupport (= 7.1.0)
      globalid (>= 0.6.0)
      nokogiri (>= 1.8.5)
    actionview (7.1.0)
      activesupport (= 7.1.0)
      builder (~> 3.1)
      erubi (~> 1.11)
      rails-dom-testing (~> 2.2)
      rails-html-sanitizer (~> 1.6)
    active_decorator (1.4.1)
      activesupport
    active_flag (1.6.0)
      activerecord (>= 5)
    active_storage_validations (1.0.3)
      activejob (>= 5.2.0)
      activemodel (>= 5.2.0)
      activestorage (>= 5.2.0)
      activesupport (>= 5.2.0)
    activejob (7.1.0)
      activesupport (= 7.1.0)
      globalid (>= 0.3.6)
    activemodel (7.1.0)
      activesupport (= 7.1.0)
    activerecord (7.1.0)
      activemodel (= 7.1.0)
      activesupport (= 7.1.0)
      timeout (>= 0.4.0)
    activestorage (7.1.0)
      actionpack (= 7.1.0)
      activejob (= 7.1.0)
      activerecord (= 7.1.0)
      activesupport (= 7.1.0)
      marcel (~> 1.0)
    activesupport (7.1.0)
      base64
      bigdecimal
      concurrent-ruby (~> 1.0, >= 1.0.2)
      connection_pool (>= 2.2.5)
      drb
      i18n (>= 1.6, < 2)
      minitest (>= 5.1)
      mutex_m
      tzinfo (~> 2.0)
    acts-as-taggable-on (10.0.0)
      activerecord (>= 6.1, < 7.2)
    addressable (2.8.5)
      public_suffix (>= 2.0.2, < 6.0)
    annotate (3.2.0)
      activerecord (>= 3.2, < 8.0)
      rake (>= 10.4, < 14.0)
    anyway_config (2.5.4)
      ruby-next-core (>= 0.14.0)
    ar_lazy_preload (1.1.2)
      rails (>= 5.2)
    ast (2.4.2)
    attr_extras (7.1.0)
    audited (5.4.2)
      activerecord (>= 5.0, < 7.2)
      request_store (~> 1.2)
    aws-eventstream (1.2.0)
    aws-partitions (1.848.0)
    aws-sdk-core (3.186.0)
      aws-eventstream (~> 1, >= 1.0.2)
      aws-partitions (~> 1, >= 1.651.0)
      aws-sigv4 (~> 1.5)
      jmespath (~> 1, >= 1.6.1)
    aws-sdk-kms (1.72.0)
      aws-sdk-core (~> 3, >= 3.184.0)
      aws-sigv4 (~> 1.1)
    aws-sdk-s3 (1.136.0)
      aws-sdk-core (~> 3, >= 3.181.0)
      aws-sdk-kms (~> 1)
      aws-sigv4 (~> 1.6)
    aws-sigv4 (1.6.1)
      aws-eventstream (~> 1, >= 1.0.2)
    axiom-types (0.1.1)
      descendants_tracker (~> 0.0.4)
      ice_nine (~> 0.11.0)
      thread_safe (~> 0.3, >= 0.3.1)
    base64 (0.2.0)
    bcrypt (3.1.19)
    bcrypt_pbkdf (1.1.0)
    better_html (2.0.2)
      actionview (>= 6.0)
      activesupport (>= 6.0)
      ast (~> 2.0)
      erubi (~> 1.4)
      parser (>= 2.4)
      smart_properties
    bigdecimal (3.1.4)
    bindex (0.8.1)
    binding_of_caller (1.0.0)
      debug_inspector (>= 0.0.1)
    bootsnap (1.16.0)
      msgpack (~> 1.2)
    brakeman (6.0.1)
    bugsnag (6.26.0)
      concurrent-ruby (~> 1.0)
    builder (3.2.4)
    bullet (7.1.2)
      activesupport (>= 3.0.0)
      uniform_notifier (~> 1.11)
    cancancan (3.5.0)
    capybara (3.39.2)
      addressable
      matrix
      mini_mime (>= 0.1.3)
      nokogiri (~> 1.8)
      rack (>= 1.6.0)
      rack-test (>= 0.6.3)
      regexp_parser (>= 1.5, < 3.0)
      xpath (~> 3.2)
    chunky_png (1.4.0)
    coderay (1.1.3)
    coercible (1.0.0)
      descendants_tracker (~> 0.0.1)
    colorize (0.8.1)
    concurrent-ruby (1.2.2)
    connection_pool (2.4.1)
    countries (5.7.0)
      unaccent (~> 0.3)
    crass (1.0.6)
    css_parser (1.16.0)
      addressable
    database_cleaner (2.0.2)
      database_cleaner-active_record (>= 2, < 3)
    database_cleaner-active_record (2.1.0)
      activerecord (>= 5.a)
      database_cleaner-core (~> 2.0.0)
    database_cleaner-core (2.0.1)
    date (3.3.4)
    debug (1.8.0)
      irb (>= 1.5.0)
      reline (>= 0.3.1)
    debug_inspector (1.1.0)
    descendants_tracker (0.0.4)
      thread_safe (~> 0.3, >= 0.3.1)
    devise (4.8.1)
      bcrypt (~> 3.0)
      orm_adapter (~> 0.1)
      railties (>= 4.1.0)
      responders
      warden (~> 1.2.3)
    devise-two-factor (5.0.0)
      activesupport (~> 7.0)
      devise (~> 4.0)
      railties (~> 7.0)
      rotp (~> 6.0)
    diff-lcs (1.5.0)
    dotenv (2.8.1)
    drb (2.2.0)
      ruby2_keywords
    ed25519 (1.3.0)
    erubi (1.12.0)
    et-orbi (1.2.7)
      tzinfo
    factory_bot (6.2.1)
      activesupport (>= 5.0.0)
    factory_bot_rails (6.2.0)
      factory_bot (~> 6.2.0)
      railties (>= 5.0.0)
    faker (3.2.0)
      i18n (>= 1.8.11, < 2)
    fasterer (0.10.1)
      colorize (~> 0.7)
      ruby_parser (>= 3.19.1)
    ffi (1.16.3)
    formatador (1.1.0)
    fugit (1.9.0)
      et-orbi (~> 1, >= 1.2.7)
      raabro (~> 1.4)
    globalid (1.2.1)
      activesupport (>= 6.1)
    good_job (3.20.0)
      activejob (>= 6.0.0)
      activerecord (>= 6.0.0)
      concurrent-ruby (>= 1.0.2)
      fugit (>= 1.1)
      railties (>= 6.0.0)
      thor (>= 0.14.1)
    guard (2.18.0)
      formatador (>= 0.2.4)
      listen (>= 2.7, < 4.0)
      lumberjack (>= 1.0.12, < 2.0)
      nenv (~> 0.1)
      notiffany (~> 0.0)
      pry (>= 0.13.0)
      shellany (~> 0.0)
      thor (>= 0.18.1)
    guard-brakeman (0.8.6)
      brakeman (>= 2.1.1)
      guard (>= 2.0.0)
      guard-compat (~> 1.0)
    guard-bundler (3.0.1)
      bundler (>= 2.1, < 3)
      guard (~> 2.2)
      guard-compat (~> 1.1)
    guard-compat (1.2.1)
    guard-fasterer (0.1.0)
      fasterer (~> 0.1)
      guard (>= 2.13.0)
      guard-compat (>= 1.2.1)
    guard-pow (2.0.0)
      guard (~> 2.0)
    guard-rspec (4.7.3)
      guard (~> 2.1)
      guard-compat (~> 1.1)
      rspec (>= 2.99.0, < 4.0)
    highline (2.1.0)
    hiredis (0.6.3)
    htmlentities (4.3.4)
    httparty (0.21.0)
      mini_mime (>= 1.0.0)
      multi_xml (>= 0.5.2)
    i18n (1.14.1)
      concurrent-ruby (~> 1.0)
    i18n-tasks (1.0.12)
      activesupport (>= 4.0.2)
      ast (>= 2.1.0)
      better_html (>= 1.0, < 3.0)
      erubi
      highline (>= 2.0.0)
      i18n
      parser (>= 2.2.3.0)
      rails-i18n
      rainbow (>= 2.2.2, < 4.0)
      terminal-table (>= 1.5.1)
    ice_nine (0.11.2)
    image_processing (1.12.2)
      mini_magick (>= 4.9.5, < 5)
      ruby-vips (>= 2.0.17, < 3)
    imgproxy (2.1.0)
      anyway_config (>= 2.0.0)
    importmap-rails (1.2.3)
      actionpack (>= 6.0.0)
      activesupport (>= 6.0.0)
      railties (>= 6.0.0)
    io-console (0.6.0)
    irb (1.9.0)
      rdoc
      reline (>= 0.3.8)
    jmespath (1.6.2)
    json (2.6.3)
    kamal (1.0.0)
      activesupport (>= 7.0)
      bcrypt_pbkdf (~> 1.0)
      concurrent-ruby (~> 1.2)
      dotenv (~> 2.8)
      ed25519 (~> 1.2)
      net-ssh (~> 7.0)
      sshkit (~> 1.21)
      thor (~> 1.2)
      zeitwerk (~> 2.5)
    kredis (1.3.0.1)
      activesupport (>= 6.0.0)
      redis (>= 4.2, < 6)
    language_server-protocol (3.17.0.3)
    launchy (2.5.2)
      addressable (~> 2.8)
    letter_opener (1.8.1)
      launchy (>= 2.2, < 3)
    listen (3.8.0)
      rb-fsevent (~> 0.10, >= 0.10.3)
      rb-inotify (~> 0.9, >= 0.9.10)
    loofah (2.21.4)
      crass (~> 1.0.2)
      nokogiri (>= 1.12.0)
    lumberjack (1.2.9)
    mail (2.8.1)
      mini_mime (>= 0.1.1)
      net-imap
      net-pop
      net-smtp
    marcel (1.0.2)
    matrix (0.4.2)
    meilisearch (0.25.1)
      httparty (>= 0.17.1, < 0.22.0)
    meilisearch-rails (0.10.1)
      meilisearch (~> 0.25.0)
    method_source (1.0.0)
    mina (1.2.4)
      open4 (~> 1.3.4)
      rake
    mini_magick (4.12.0)
    mini_mime (1.1.5)
    minitest (5.20.0)
    monetize (1.12.0)
      money (~> 6.12)
    money (6.16.0)
      i18n (>= 0.6.4, <= 2)
    money-rails (1.15.0)
      activesupport (>= 3.0)
      monetize (~> 1.9)
      money (~> 6.13)
      railties (>= 3.0)
    motor-admin (0.4.11)
      ar_lazy_preload (~> 1.0)
      audited (~> 5.0)
      cancancan (~> 3.0)
      fugit (~> 1.0)
      rails (>= 5.2)
    msgpack (1.7.2)
    multi_xml (0.6.0)
    mutex_m (0.2.0)
    nenv (0.3.0)
    net-imap (0.4.4)
      date
      net-protocol
    net-pop (0.1.2)
      net-protocol
    net-protocol (0.2.2)
      timeout
    net-scp (4.0.0)
      net-ssh (>= 2.6.5, < 8.0.0)
    net-smtp (0.4.0)
      net-protocol
    net-ssh (7.2.0)
    nio4r (2.5.9)
    nokogiri (1.15.4-arm64-darwin)
      racc (~> 1.4)
    nokogiri (1.15.4-x86_64-linux)
      racc (~> 1.4)
    notiffany (0.1.3)
      nenv (~> 0.1)
      shellany (~> 0.0)
    open4 (1.3.4)
    optimist (3.1.0)
    orm_adapter (0.5.0)
    pagy (6.0.4)
    parallel (1.23.0)
    parser (3.2.2.4)
      ast (~> 2.4.1)
      racc
    patience_diff (1.2.0)
      optimist (~> 3.0)
    pdf-core (0.9.0)
    pg (1.4.6)
    pgreset (0.4)
    prawn (2.4.0)
      pdf-core (~> 0.9.0)
      ttfunk (~> 1.7)
    prawn-table (0.2.2)
      prawn (>= 1.3.0, < 3.0.0)
    premailer (1.21.0)
      addressable
      css_parser (>= 1.12.0)
      htmlentities (>= 4.0.0)
    premailer-rails (1.12.0)
      actionmailer (>= 3)
      net-smtp
      premailer (~> 1.7, >= 1.7.9)
    propshaft (0.8.0)
      actionpack (>= 7.0.0)
      activesupport (>= 7.0.0)
      rack
      railties (>= 7.0.0)
    pry (0.14.2)
      coderay (~> 1.1)
      method_source (~> 1.0)
    pry-stack_explorer (0.6.1)
      binding_of_caller (~> 1.0)
      pry (~> 0.13)
    psych (5.1.1.1)
      stringio
    public_suffix (5.0.3)
    puma (6.4.0)
      nio4r (~> 2.0)
    pundit (2.3.0)
      activesupport (>= 3.0.0)
    pundit-matchers (3.1.2)
      rspec-core (~> 3.12)
      rspec-expectations (~> 3.12)
      rspec-mocks (~> 3.12)
      rspec-support (~> 3.12)
    raabro (1.4.0)
    racc (1.7.3)
    rack (3.0.8)
    rack-session (2.0.0)
      rack (>= 3.0.0)
    rack-test (2.1.0)
      rack (>= 1.3)
    rackup (2.1.0)
      rack (>= 3)
      webrick (~> 1.8)
    rails (7.1.0)
      actioncable (= 7.1.0)
      actionmailbox (= 7.1.0)
      actionmailer (= 7.1.0)
      actionpack (= 7.1.0)
      actiontext (= 7.1.0)
      actionview (= 7.1.0)
      activejob (= 7.1.0)
      activemodel (= 7.1.0)
      activerecord (= 7.1.0)
      activestorage (= 7.1.0)
      activesupport (= 7.1.0)
      bundler (>= 1.15.0)
      railties (= 7.1.0)
    rails-dom-testing (2.2.0)
      activesupport (>= 5.0.0)
      minitest
      nokogiri (>= 1.6)
    rails-html-sanitizer (1.6.0)
      loofah (~> 2.21)
      nokogiri (~> 1.14)
    rails-i18n (7.0.8)
      i18n (>= 0.7, < 2)
      railties (>= 6.0.0, < 8)
    rails-patterns (0.11.0)
      actionpack (>= 4.2.6)
      activerecord (>= 4.2.6)
      ruby2_keywords
      virtus
    rails_live_reload (0.3.4)
      listen
      nio4r
      railties
      websocket-driver
    railties (7.1.0)
      actionpack (= 7.1.0)
      activesupport (= 7.1.0)
      irb
      rackup (>= 1.0.0)
      rake (>= 12.2)
      thor (~> 1.0, >= 1.2.2)
      zeitwerk (~> 2.6)
    rainbow (3.1.1)
    rake (13.1.0)
    ransack (4.0.0)
      activerecord (>= 6.1.5)
      activesupport (>= 6.1.5)
      i18n
    rb-fsevent (0.11.2)
    rb-inotify (0.10.1)
      ffi (~> 1.0)
    rdoc (6.6.0)
      psych (>= 4.0.0)
    redis (5.0.8)
      redis-client (>= 0.17.0)
    redis-client (0.18.0)
      connection_pool
    regexp_parser (2.8.2)
    reline (0.4.0)
      io-console (~> 0.5)
    request_store (1.5.1)
      rack (>= 1.4)
    responders (3.1.1)
      actionpack (>= 5.2)
      railties (>= 5.2)
    rexml (3.2.6)
    rotp (6.3.0)
    rqrcode (2.2.0)
      chunky_png (~> 1.0)
      rqrcode_core (~> 1.0)
    rqrcode_core (1.2.0)
    rspec (3.12.0)
      rspec-core (~> 3.12.0)
      rspec-expectations (~> 3.12.0)
      rspec-mocks (~> 3.12.0)
    rspec-core (3.12.2)
      rspec-support (~> 3.12.0)
    rspec-expectations (3.12.3)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.12.0)
    rspec-mocks (3.12.6)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.12.0)
    rspec-rails (6.0.1)
      actionpack (>= 6.1)
      activesupport (>= 6.1)
      railties (>= 6.1)
      rspec-core (~> 3.11)
      rspec-expectations (~> 3.11)
      rspec-mocks (~> 3.11)
      rspec-support (~> 3.11)
    rspec-support (3.12.1)
    rspec_junit_formatter (0.6.0)
      rspec-core (>= 2, < 4, != 2.12.0)
    rubocop (1.57.2)
      json (~> 2.3)
      language_server-protocol (>= 3.17.0)
      parallel (~> 1.10)
      parser (>= 3.2.2.4)
      rainbow (>= 2.2.2, < 4.0)
      regexp_parser (>= 1.8, < 3.0)
      rexml (>= 3.2.5, < 4.0)
      rubocop-ast (>= 1.28.1, < 2.0)
      ruby-progressbar (~> 1.7)
      unicode-display_width (>= 2.4.0, < 3.0)
    rubocop-ast (1.30.0)
      parser (>= 3.2.1.0)
    rubocop-daemon (0.3.2)
      rubocop
    rubocop-packaging (0.5.2)
      rubocop (>= 1.33, < 2.0)
    rubocop-performance (1.19.1)
      rubocop (>= 1.7.0, < 2.0)
      rubocop-ast (>= 0.4.0)
    rubocop-rails (2.19.1)
      activesupport (>= 4.2.0)
      rack (>= 1.1)
      rubocop (>= 1.33.0, < 2.0)
    ruby-next-core (0.15.3)
    ruby-progressbar (1.13.0)
    ruby-vips (2.2.0)
      ffi (~> 1.12)
    ruby2_keywords (0.0.5)
    ruby_parser (3.20.3)
      sexp_processor (~> 4.16)
    rubyzip (2.3.2)
    selenium-webdriver (4.14.0)
      rexml (~> 3.2, >= 3.2.5)
      rubyzip (>= 1.2.2, < 3.0)
      websocket (~> 1.0)
    sexp_processor (4.17.0)
    shellany (0.0.1)
    skylight (6.0.1)
      activesupport (>= 5.2.0)
    smart_properties (1.17.0)
    solid_cache (0.1.0)
      rails (>= 7)
    sshkit (1.21.5)
      net-scp (>= 1.1.2)
      net-ssh (>= 2.8.0)
    stimulus-rails (1.2.1)
      railties (>= 6.0.0)
    stringio (3.0.9)
    super_diff (0.10.0)
      attr_extras (>= 6.2.4)
      diff-lcs
      patience_diff
    tailwindcss-rails (2.0.27-arm64-darwin)
      railties (>= 6.0.0)
    tailwindcss-rails (2.0.27-x86_64-linux)
      railties (>= 6.0.0)
    telephone_number (1.4.20)
    terminal-table (3.0.2)
      unicode-display_width (>= 1.1.1, < 3)
    thor (1.3.0)
    thread_safe (0.3.6)
    timeout (0.4.1)
    ttfunk (1.7.0)
    turbo-rails (1.4.0)
      actionpack (>= 6.0.0)
      activejob (>= 6.0.0)
      railties (>= 6.0.0)
    tzinfo (2.0.6)
      concurrent-ruby (~> 1.0)
    unaccent (0.4.0)
    unicode-display_width (2.5.0)
    uniform_notifier (1.16.0)
    unread (0.12.0)
      activerecord (>= 3)
    view_component (2.82.0)
      activesupport (>= 5.2.0, < 8.0)
      concurrent-ruby (~> 1.0)
      method_source (~> 1.0)
    view_component-contrib (0.1.3)
      ruby-next-core (>= 0.12.0)
      view_component
    virtus (2.0.0)
      axiom-types (~> 0.1)
      coercible (~> 1.0)
      descendants_tracker (~> 0.0, >= 0.0.3)
    warden (1.2.9)
      rack (>= 2.0.9)
    web-console (4.2.1)
      actionview (>= 6.0.0)
      activemodel (>= 6.0.0)
      bindex (>= 0.4.0)
      railties (>= 6.0.0)
    webrick (1.8.1)
    websocket (1.2.10)
    websocket-driver (0.7.6)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.5)
    xpath (3.2.0)
      nokogiri (~> 1.8)
    zeitwerk (2.6.12)

PLATFORMS
  arm64-darwin-22
  x86_64-linux

DEPENDENCIES
  active_decorator (= 1.4.1)
  active_flag (= 1.6.0)
  active_storage_validations (= 1.0.3)
  acts-as-taggable-on (= 10.0.0)
  annotate (= 3.2.0)
  aws-sdk-s3 (= 1.136.0)
  bootsnap (= 1.16.0)
  brakeman (= 6.0.1)
  bugsnag (= 6.26.0)
  bullet (= 7.1.2)
  countries (= 5.7.0)
  database_cleaner (= 2.0.2)
  debug (= 1.8.0)
  devise (= 4.8.1)
  devise-two-factor (= 5.0.0)
  factory_bot_rails (= 6.2.0)
  faker (= 3.2.0)
  fasterer (= 0.10.1)
  good_job (= 3.20.0)
  guard (= 2.18.0)
  guard-brakeman (= 0.8.6)
  guard-bundler (= 3.0.1)
  guard-fasterer (= 0.1.0)
  guard-pow (= 2.0.0)
  guard-rspec (= 4.7.3)
  hiredis (= 0.6.3)
  httparty (= 0.21.0)
  i18n-tasks (= 1.0.12)
  image_processing (= 1.12.2)
  imgproxy (= 2.1.0)
  importmap-rails (= 1.2.3)
  kamal (= 1.0)
  kredis (= 1.3.0.1)
  letter_opener (= 1.8.1)
  magic_test!
  matrix (= 0.4.2)
  meilisearch-rails (= 0.10.1)
  mina (= 1.2.4)
  money-rails (= 1.15.0)
  motor-admin (= 0.4.11)
  pagy (= 6.0.4)
  pg (= 1.4.6)
  pgreset (= 0.4)
  prawn (= 2.4)
  prawn-table (= 0.2.2)
  premailer-rails (= 1.12.0)
  propshaft (= 0.8.0)
  puma (= 6.4.0)
  pundit (= 2.3.0)
  pundit-matchers (= 3.1.2)
  rails (= 7.1.0)
  rails-patterns (= 0.11.0)
  rails_live_reload (= 0.3.4)
  ransack (= 4.0.0)
  rqrcode (= 2.2.0)
  rspec-rails (= 6.0.1)
  rspec_junit_formatter (= 0.6.0)
  rubocop (= 1.57.2)
  rubocop-daemon (= 0.3.2)
  rubocop-packaging (= 0.5.2)
  rubocop-performance (= 1.19.1)
  rubocop-rails (= 2.19.1)
  ruby-progressbar (= 1.13.0)
  selenium-webdriver (= 4.14.0)
  skylight (= 6.0.1)
  solid_cache (= 0.1.0)
  stimulus-rails (= 1.2.1)
  super_diff (= 0.10.0)
  tailwindcss-rails (= 2.0.27)
  telephone_number (= 1.4.20)
  turbo-rails (= 1.4.0)
  tzinfo-data (= 1.2023.3)
  unread (= 0.12.0)
  view_component (= 2.82.0)
  view_component-contrib (= 0.1.3)
  web-console (= 4.2.1)

RUBY VERSION
   ruby 3.1.4p223

BUNDLED WITH
   2.4.19

While i personally don't have psych in my Gemfile, there's railties -> irb -> rdoc -> psych >= 4.0.0 and the single psych (5.1.1.1) in the lock file. libyaml-dev is installed via apt.

=> gem pristine psych --version 5.1.1.1

Restoring gems to pristine condition...
Building native extensions. This could take a while...
Restored psych-5.1.1.1

=> bundle add psych

Ignoring psych-5.1.1.1 because its extensions are not built. Try: gem pristine psych --version 5.1.1.1
--- ERROR REPORT TEMPLATE -------------------------------------------------------

NoMethodError: undefined method `_native_parse' for #<Psych::Parser:0x00007f53655ff5e0 @handler=#<Psych::Handlers::DocumentStream:0x00007f53655ff8d8 @stack=[], @last=nil, @root=nil, @start_line=nil, @start_column=nil, @end_line=nil, @end_column=nil, @block=#<Proc:0x00007f53655ff658 /var/www/prickkoll.se/staging/shared/vendor/bundle/ruby/3.1.0/gems/psych-5.1.1.1/lib/psych.rb:399>>, @external_encoding=0>

      _native_parse @handler, yaml, path
      ^^^^^^^^^^^^^

@zvkemp
Copy link
Contributor

zvkemp commented Nov 11, 2023

I believe you are encountering this Ruby bug: https://ml.ruby-lang.org/mailman3/hyperkitty/list/ruby-core@ml.ruby-lang.org/message/ZYU7X5A336FDS3BRM37NL47VWJXE3GGP/

It seems you can remove Psych 5 if it is not explicitly required by your Gemfile.lock.

On our side, I will investigate bundling a specific YAML parser (or using a different format during extconf) to avoid the issue entirely.

@zvkemp zvkemp reopened this Nov 11, 2023
@Frexuz
Copy link

Frexuz commented Nov 12, 2023

I had to manually remove psych (5.1.1.1) from the lockfile, as nothing else was dependent on it (at some previous point I guess?). It didn't even disappear from the lockfile when specifying psych 4.x in the gemfile 🤷

then then migrating, for some reason i had to completely clean the bundle cache with bundle clean (ssh to the machine), otherwise it still failed with compiling the c-extension 🤷

not sure if there's another way, but at least i could continue, and use skylight now :)

@zvkemp
Copy link
Contributor

zvkemp commented Nov 30, 2023

It seems this issue was fixed in Rubygems 3.4.9 (https://github.com/rubygems/rubygems/blob/master/CHANGELOG.md#349--2023-03-20). gem update --system should update your version of rubygems and allow correct usage of YAML in extconf.

@zvkemp
Copy link
Contributor

zvkemp commented Jan 9, 2024

This issue is now bypassed in v6.0.2 — we no longer require yaml during extconf.

@zvkemp zvkemp closed this as completed Jan 9, 2024
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

6 participants