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

fresh install of ruby and asciidoctor-pdf does not work #775

Closed
gxurma opened this issue Mar 14, 2017 · 20 comments
Closed

fresh install of ruby and asciidoctor-pdf does not work #775

gxurma opened this issue Mar 14, 2017 · 20 comments
Assignees

Comments

@gxurma
Copy link

gxurma commented Mar 14, 2017

Have installed everything on a virgin windows PC using gem. Something seems to be missing...

>ruby --version
ruby 2.2.6p396 (2016-11-15 revision 56800) [i386-mingw32]

>asciidoctor-pdf -v
C:/Ruby22/lib/ruby/gems/2.2.0/gems/prawn-templates-0.0.3/lib/prawn/templates.rb:246:in `<top (required)>': can't modify frozen Array (RuntimeError)
    from C:/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `require'
    from C:/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
    from C:/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in `require'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/asciidoctor-pdf-1.5.0.alpha.14/lib/asciidoctor-pdf/converter.rb:10:in `<top (required)>'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/asciidoctor-pdf-1.5.0.alpha.14/lib/asciidoctor-pdf.rb:3:in `require_relative'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/asciidoctor-pdf-1.5.0.alpha.14/lib/asciidoctor-pdf.rb:3:in `<top (required)>'
    from C:/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from C:/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/asciidoctor-pdf-1.5.0.alpha.14/bin/asciidoctor-pdf:4:in `<top (required)>'
    from C:/Ruby22/bin/asciidoctor-pdf:23:in `load'
    from C:/Ruby22/bin/asciidoctor-pdf:23:in `<main>'
@gxurma
Copy link
Author

gxurma commented Mar 14, 2017

Similar problem also on Ubuntu...

@BohdanLevchenko
Copy link

The same problem on OSX

[~]$ ruby --version
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]

[~]$ asciidoctor-pdf -v
/usr/local/lib/ruby/gems/2.4.0/gems/prawn-templates-0.0.3/lib/prawn/templates.rb:246:in `<top (required)>': can't modify frozen Array (RuntimeError)
	from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-pdf-1.5.0.alpha.14/lib/asciidoctor-pdf/converter.rb:10:in `<top (required)>'
	from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-pdf-1.5.0.alpha.14/lib/asciidoctor-pdf.rb:3:in `require_relative'
	from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-pdf-1.5.0.alpha.14/lib/asciidoctor-pdf.rb:3:in `<top (required)>'
	from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:120:in `require'
	from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:120:in `require'
	from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-pdf-1.5.0.alpha.14/bin/asciidoctor-pdf:4:in `<top (required)>'
	from /usr/local/bin/asciidoctor-pdf:22:in `load'
	from /usr/local/bin/asciidoctor-pdf:22:in `<main>'

@BohdanLevchenko
Copy link

It seems that updating prawn to 2.1.0 can solve the problem

@gxurma
Copy link
Author

gxurma commented Mar 14, 2017

Made
gem update
that did not help.

Updating to prawn 2.1.0: Does not help for me:

	>gem install prawn -v 2.1.0 
	Fetching: pdf-core-0.6.1.gem (100%)
	Successfully installed pdf-core-0.6.1
	Fetching: ttfunk-1.4.0.gem (100%)
	Successfully installed ttfunk-1.4.0
	Fetching: prawn-2.1.0.gem (100%)
	Successfully installed prawn-2.1.0
	Parsing documentation for pdf-core-0.6.1
	Installing ri documentation for pdf-core-0.6.1
	Parsing documentation for ttfunk-1.4.0
	Installing ri documentation for ttfunk-1.4.0
	Parsing documentation for prawn-2.1.0
	Installing ri documentation for prawn-2.1.0
	Done installing documentation for pdf-core, ttfunk, prawn after 7 seconds
	3 gems installed
	
	>asciidoctor-pdf -v
	C:/Ruby22/lib/ruby/gems/2.2.0/gems/prawn-templates-0.0.4/lib/prawn/templates.rb:254:in `<top (required)>': can't modify frozen Array (RuntimeError)
			from C:/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `require'
			from C:/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
			from C:/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in `require'
			from C:/Ruby22/lib/ruby/gems/2.2.0/gems/asciidoctor-pdf-1.5.0.alpha.14/lib/asciidoctor-pdf/converter.rb:10:in `<top (required)>'
			from C:/Ruby22/lib/ruby/gems/2.2.0/gems/asciidoctor-pdf-1.5.0.alpha.14/lib/asciidoctor-pdf.rb:3:in `require_relative'
			from C:/Ruby22/lib/ruby/gems/2.2.0/gems/asciidoctor-pdf-1.5.0.alpha.14/lib/asciidoctor-pdf.rb:3:in `<top (required)>'
			from C:/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
			from C:/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
			from C:/Ruby22/lib/ruby/gems/2.2.0/gems/asciidoctor-pdf-1.5.0.alpha.14/bin/asciidoctor-pdf:4:in `<top (required)>'
			from C:/Ruby22/bin/asciidoctor-pdf:23:in `load'
			from C:/Ruby22/bin/asciidoctor-pdf:23:in `<main>'

@gxurma
Copy link
Author

gxurma commented Mar 14, 2017

Needed to do

    >gem uninstall prawn -v 2.2.0

then it worked.

@mojavelinux
Copy link
Member

mojavelinux commented Mar 14, 2017 via email

@mojavelinux
Copy link
Member

I'm going to keep this issue open so that people can find it until the new release is out.

@mojavelinux mojavelinux added this to the v1.5.0.alpha.15 milestone Mar 14, 2017
@nathany
Copy link

nathany commented Mar 15, 2017

The relevant issue in prawn-templates is prawnpdf/prawn-templates#14 which is apparently resolved on master.

I'm reverting to Prawn 2.1.0 for now.

@mojavelinux
Copy link
Member

That's one problem. There were others. I'll do an alpha.15 release this weekend so we can get past this workaround.

@bvogel
Copy link

bvogel commented Mar 16, 2017

Can anyone postback if the current master of prawn-templates with prawn 2.2.1 fixes the issue? Once confirmed, I'd go ahead and push the release then.

@greenx
Copy link

greenx commented Mar 16, 2017

# gem update prawn
Updating installed gems
Updating prawn
Fetching: prawn-2.2.1.gem (100%)
Successfully installed prawn-2.2.1
Parsing documentation for prawn-2.2.1
Installing ri documentation for prawn-2.2.1
Installing darkfish documentation for prawn-2.2.1
Done installing documentation for prawn after 3 seconds
Parsing documentation for prawn-2.2.1
Done installing documentation for prawn after 1 seconds
Gems updated: prawn
^D
> asciidoctor-pdf.ruby2.2 -v
/usr/lib64/ruby/gems/2.2.0/gems/prawn-templates-0.0.3/lib/prawn/templates.rb:246:in `<top (required)>': can't modify frozen Array (RuntimeError)
        from /usr/lib64/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `require'
        from /usr/lib64/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
        from /usr/lib64/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in `require'
        from /usr/lib64/ruby/gems/2.2.0/gems/asciidoctor-pdf-1.5.0.alpha.14/lib/asciidoctor-pdf/converter.rb:10:in `<top (required)>'
        from /usr/lib64/ruby/gems/2.2.0/gems/asciidoctor-pdf-1.5.0.alpha.14/lib/asciidoctor-pdf.rb:3:in `require_relative'
        from /usr/lib64/ruby/gems/2.2.0/gems/asciidoctor-pdf-1.5.0.alpha.14/lib/asciidoctor-pdf.rb:3:in `<top (required)>'
        from /usr/lib64/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/lib64/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/lib64/ruby/gems/2.2.0/gems/asciidoctor-pdf-1.5.0.alpha.14/bin/asciidoctor-pdf:4:in `<top (required)>'
        from /usr/bin/asciidoctor-pdf.ruby2.2:23:in `load'
        from /usr/bin/asciidoctor-pdf.ruby2.2:23:in `<main>'

@bvogel
Copy link

bvogel commented Mar 16, 2017

Sorry, if I wasn't precise - I was referring to master of prawn-templates

@mojavelinux
Copy link
Member

@bvogel It will work because I added a workaround. The workaround would need to be removed in order to check. I'll do that now.

@mojavelinux
Copy link
Member

It works, but it generates a warning. I recommend using the workaround that I came up instead.

See https://github.com/asciidoctor/asciidoctor-pdf/blob/master/lib/asciidoctor-pdf/prawn-templates_ext.rb#L2

@mojavelinux
Copy link
Member

(I didn't bother refreezing since I really see no point in freezing this array in the first place).

@bvogel
Copy link

bvogel commented Mar 17, 2017

I didn't bother about the warning, you about re-freezing... I'll change my code an push the gem... Thanks for testing!

@bvogel
Copy link

bvogel commented Mar 20, 2017

issue has been fixed in prawn-templates 0.0.5

@mojavelinux
Copy link
Member

@bvogel Thanks for letting me know. I'll update Asciidoctor PDF and put out a new release.

While we're chatting, I want to emphasize how important prawn-templates is for Asciidoctor PDF. Many users need to be able to import PDF pages from other sources and prawn-templates allows us to provide that feature. We're happy to see it being maintained. Thanks!

@mojavelinux mojavelinux self-assigned this Mar 21, 2017
@mojavelinux
Copy link
Member

I'm starting to work on the alpha.15 release.

@mojavelinux
Copy link
Member

This is resolved in the upcoming alpha.15 release.

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

No branches or pull requests

6 participants