prawnpdf/prawn

Require Error on Ruby 3.1.0 - Matrix

ticktricktrack opened this issue ยท 5 comments

On Ruby 3.1.0 I'm running into a problem loading prawn. It's a Gemfile with 40 gems, including prawn-svg, prawn-gmagick and prawn-table, I'll see if I can make a minimized failing example.

no issues with 3.0.3

An error occurred while loading spec_helper. - Did you mean?
                    rspec ./spec/spec_helper.rb

Failure/Error: require 'prawn'

LoadError:
  cannot load such file -- matrix
# ./spec/spec_helper.rb:6:in `require'
# ./spec/spec_helper.rb:6:in `<top (required)>'

This is fixed in master. I guess it's a duplicate of #1195.

Great! I'll wait for the release then!

Hi, I just ran into this too. Will there be a prawn release that includes this fix, for compatibility with ruby 3.1?

@jrochkind my solution back in January was

# Fast, Nimble PDF Writer for Ruby
gem 'prawn'

# Can be removed with the next Prawn update
gem 'matrix'
korrs commented

Faced with the same issue on ruby 3.1.

Getting the same error:
.../ruby-3.1.0/gems/prawn-2.4.0/lib/prawn/transformation_stack.rb:10:in `require': cannot load such file -- matrix (LoadError)

It works with specifying of matrix gem in Gemfile, but I suppose it should work without this hack