asciidoctor / asciidoctor-mathematical

An extension for Asciidoctor that converts the content of STEM blocks and inline macros using Mathematical.
MIT License
49 stars 44 forks source link

gsub!': asciidoctor: FAILED to load AsciiDoc document - can't modify frozen String (FrozenError) #56

Closed siddjain closed 3 years ago

siddjain commented 5 years ago

I am getting this error while trying to use asciidoctor-mathematical from the docker image https://github.com/asciidoctor/docker-asciidoctor. wondering if anyone can help with this.

bash-4.4# asciidoctor-pdf -r asciidoctor-mathematical -o test.pdf chap01.adoc --trace
Traceback (most recent call last):
    20: from /usr/bin/asciidoctor-pdf:23:in `<main>'
    19: from /usr/bin/asciidoctor-pdf:23:in `load'
    18: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-pdf-1.5.0.alpha.18/bin/asciidoctor-pdf:31:in `<top (required)>'
    17: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.10/lib/asciidoctor/cli/invoker.rb:111:in `invoke!'
    16: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.10/lib/asciidoctor/cli/invoker.rb:111:in `each'
    15: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.10/lib/asciidoctor/cli/invoker.rb:128:in `block in invoke!'
    14: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:183:in `convert_file'
    13: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:183:in `open'
    12: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:183:in `block in convert_file'
    11: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:78:in `convert'
    10: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.10/lib/asciidoctor/load.rb:83:in `load'
     9: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.10/lib/asciidoctor/document.rb:555:in `parse'
     8: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.10/lib/asciidoctor/document.rb:555:in `each'
     7: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.10/lib/asciidoctor/document.rb:556:in `block in parse'
     6: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.10/lib/asciidoctor/document.rb:556:in `[]'
     5: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-mathematical-0.3.0/lib/asciidoctor-mathematical/extension.rb:40:in `process'
     4: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-mathematical-0.3.0/lib/asciidoctor-mathematical/extension.rb:40:in `each'
     3: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-mathematical-0.3.0/lib/asciidoctor-mathematical/extension.rb:41:in `block in process'
     2: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-mathematical-0.3.0/lib/asciidoctor-mathematical/extension.rb:100:in `handle_prose_block'
     1: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-mathematical-0.3.0/lib/asciidoctor-mathematical/extension.rb:135:in `handle_inline_stem'
/usr/lib/ruby/gems/2.5.0/gems/asciidoctor-mathematical-0.3.0/lib/asciidoctor-mathematical/extension.rb:135:in `gsub!': asciidoctor: FAILED: /documents/chap01/chap01.adoc: Failed to load AsciiDoc document - can't modify frozen String (FrozenError)
siddjain commented 5 years ago

Is it okay to cross-list this issue at https://github.com/asciidoctor/docker-asciidoctor? I am not getting any response here

ProgramFan commented 5 years ago

asciidoctor-mathematical shall be updated not to modify string in-place. Have you tested the version on master?

siddjain commented 5 years ago

we are using the docker image. could someone please update the docker image with the fix? is there link to a bug and changeset that fixes this problem?


From: Zhang YANG notifications@github.com Sent: Thursday, August 1, 2019 8:59 AM To: asciidoctor/asciidoctor-mathematical asciidoctor-mathematical@noreply.github.com Cc: siddjain siddjain@live.com; Author author@noreply.github.com Subject: Re: [asciidoctor/asciidoctor-mathematical] gsub!': asciidoctor: FAILED to load AsciiDoc document - can't modify frozen String (FrozenError) (#56)

asciidoctor-mathematical shall be updated not to modify string in-place. Have you tested the version on master?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fasciidoctor%2Fasciidoctor-mathematical%2Fissues%2F56%3Femail_source%3Dnotifications%26email_token%3DAAFZEMOEVBYTYENAFSQLLPLQCMB6ZA5CNFSM4IHVIYH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3LCFMI%23issuecomment-517350065&data=02%7C01%7C%7C49b4b1bbf64e4cbb1d8208d716994406%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637002719831290749&sdata=Lm7hiqdO%2BgGYQog6g9aDwW130dur9GfYYHCjkGzMGIM%3D&reserved=0, or mute the threadhttps://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAFZEMPINEI2HJPBOZZVA73QCMB6ZANCNFSM4IHVIYHQ&data=02%7C01%7C%7C49b4b1bbf64e4cbb1d8208d716994406%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637002719831300753&sdata=N9iZLitJvX5Gyn1y08nWVdQhXc2BprqTGhaluSdijx8%3D&reserved=0.

ProgramFan commented 5 years ago

It seems the issue is fixed in master and we need a new release. Would you please make a release from the current master to fix the frozen-string issue? @tstumm

ProgramFan commented 5 years ago

Meanwhile, you can update the docker file and build the docker image your self. Even after we make the release, you still have to do it to get a new docker image, or you have to wait until they make a release. @siddjain

siddjain commented 5 years ago

what are the steps for me to build a new docker image myself (which has this fix) so that I am not blocked by a new release? thanks


From: Zhang YANG notifications@github.com Sent: Thursday, August 1, 2019 9:11 AM To: asciidoctor/asciidoctor-mathematical asciidoctor-mathematical@noreply.github.com Cc: siddjain siddjain@live.com; Mention mention@noreply.github.com Subject: Re: [asciidoctor/asciidoctor-mathematical] gsub!': asciidoctor: FAILED to load AsciiDoc document - can't modify frozen String (FrozenError) (#56)

Meanwhile, you can update the docker file and build the docker image your self. Even after we make the release, you still have to do it to get a new docker image, or you have to wait until they make a release. @siddjainhttps://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsiddjain&data=02%7C01%7C%7Ca3490ff184b74bbaa13f08d7169addc5%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637002726705592868&sdata=uIjtHdssc1vrGhihXKOYq4aOWlxEzR0hQBdkm%2BAIkV8%3D&reserved=0

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fasciidoctor%2Fasciidoctor-mathematical%2Fissues%2F56%3Femail_source%3Dnotifications%26email_token%3DAAFZEMNWZ2FUIHDMR36WEF3QCMDJXA5CNFSM4IHVIYH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3LDKNI%23issuecomment-517354805&data=02%7C01%7C%7Ca3490ff184b74bbaa13f08d7169addc5%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637002726705602873&sdata=CCm04uNCPCLpRABc8zcUlnVRLrm69IMNAb2XfWXxziQ%3D&reserved=0, or mute the threadhttps://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAFZEMNRWJEFNHRR2IW2DSTQCMDJXANCNFSM4IHVIYHQ&data=02%7C01%7C%7Ca3490ff184b74bbaa13f08d7169addc5%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637002726705612884&sdata=2TTZxA6qPTz5%2FElhmyc0w2YbavosNSsGIG6PKleCMLQ%3D&reserved=0.

ProgramFan commented 5 years ago

You will have to learn a bit docker and Google can help youl

siddjain commented 5 years ago

could the changeset that fixes this bug be please linked to this thread?


From: Zhang YANG notifications@github.com Sent: Thursday, August 1, 2019 9:16 AM To: asciidoctor/asciidoctor-mathematical asciidoctor-mathematical@noreply.github.com Cc: siddjain siddjain@live.com; Mention mention@noreply.github.com Subject: Re: [asciidoctor/asciidoctor-mathematical] gsub!': asciidoctor: FAILED to load AsciiDoc document - can't modify frozen String (FrozenError) (#56)

You will have to learn a bit docker and Google can help youl

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fasciidoctor%2Fasciidoctor-mathematical%2Fissues%2F56%3Femail_source%3Dnotifications%26email_token%3DAAFZEMOMMOSCTV774USMTL3QCMD4TA5CNFSM4IHVIYH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3LD2AQ%23issuecomment-517356802&data=02%7C01%7C%7Ccfbf241f75ab4f1656b908d7169b90f3%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637002729714335940&sdata=z8bOjzs4BjzCQoVQ1u0ZmQqH2y6s3T33AeVZDeaBk6o%3D&reserved=0, or mute the threadhttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAFZEMJN6SIX5BFJAN7PHOTQCMD4TANCNFSM4IHVIYHQ&data=02%7C01%7C%7Ccfbf241f75ab4f1656b908d7169b90f3%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637002729714345951&sdata=zfA8eaaoezuLK%2Blkh4qwEUs9obd%2BR2nXQTV5JdYrDHA%3D&reserved=0.

siddjain commented 5 years ago

ping on this. any ETA when a new version will be released?


From: Zhang YANG notifications@github.com Sent: Thursday, August 1, 2019 9:16 AM To: asciidoctor/asciidoctor-mathematical asciidoctor-mathematical@noreply.github.com Cc: siddjain siddjain@live.com; Mention mention@noreply.github.com Subject: Re: [asciidoctor/asciidoctor-mathematical] gsub!': asciidoctor: FAILED to load AsciiDoc document - can't modify frozen String (FrozenError) (#56)

You will have to learn a bit docker and Google can help youl

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fasciidoctor%2Fasciidoctor-mathematical%2Fissues%2F56%3Femail_source%3Dnotifications%26email_token%3DAAFZEMOMMOSCTV774USMTL3QCMD4TA5CNFSM4IHVIYH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3LD2AQ%23issuecomment-517356802&data=02%7C01%7C%7Ccfbf241f75ab4f1656b908d7169b90f3%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637002729714335940&sdata=z8bOjzs4BjzCQoVQ1u0ZmQqH2y6s3T33AeVZDeaBk6o%3D&reserved=0, or mute the threadhttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAFZEMJN6SIX5BFJAN7PHOTQCMD4TANCNFSM4IHVIYHQ&data=02%7C01%7C%7Ccfbf241f75ab4f1656b908d7169b90f3%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637002729714345951&sdata=zfA8eaaoezuLK%2Blkh4qwEUs9obd%2BR2nXQTV5JdYrDHA%3D&reserved=0.

tstumm commented 5 years ago

Try updating to 0.3.1.

siddjain commented 5 years ago

I get this with 0.3.1

bash-4.4# asciidoctor-pdf -r asciidoctor-mathematical -o test.pdf chap01.adoc --trace
asciidoctor: WARNING: conversion missing in backend pdf for stem
asciidoctor: WARNING: conversion missing in backend pdf for stem
asciidoctor: WARNING: conversion missing in backend pdf for stem

and the math does not render in the pdf

siddjain commented 5 years ago

docker build log can be seen here https://gist.github.com/siddjain/e623c801157a12a37c04b8d84c070d9b it says Successfully installed asciidoctor-mathematical-0.3.1

siddjain commented 5 years ago

also this:

bash-4.4# ls /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-mathematical-0.3.1/lib asciidoctor-mathematical asciidoctor-mathematical.rb


From: Siddharth Jain siddjain@live.com Sent: Wednesday, August 7, 2019 4:39 PM To: asciidoctor/asciidoctor-mathematical reply@reply.github.com Subject: Re: [asciidoctor/asciidoctor-mathematical] gsub!': asciidoctor: FAILED to load AsciiDoc document - can't modify frozen String (FrozenError) (#56)

ping on this. any ETA when a new version will be released?


From: Zhang YANG notifications@github.com Sent: Thursday, August 1, 2019 9:16 AM To: asciidoctor/asciidoctor-mathematical asciidoctor-mathematical@noreply.github.com Cc: siddjain siddjain@live.com; Mention mention@noreply.github.com Subject: Re: [asciidoctor/asciidoctor-mathematical] gsub!': asciidoctor: FAILED to load AsciiDoc document - can't modify frozen String (FrozenError) (#56)

You will have to learn a bit docker and Google can help youl

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fasciidoctor%2Fasciidoctor-mathematical%2Fissues%2F56%3Femail_source%3Dnotifications%26email_token%3DAAFZEMOMMOSCTV774USMTL3QCMD4TA5CNFSM4IHVIYH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3LD2AQ%23issuecomment-517356802&data=02%7C01%7C%7Ccfbf241f75ab4f1656b908d7169b90f3%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637002729714335940&sdata=z8bOjzs4BjzCQoVQ1u0ZmQqH2y6s3T33AeVZDeaBk6o%3D&reserved=0, or mute the threadhttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAFZEMJN6SIX5BFJAN7PHOTQCMD4TANCNFSM4IHVIYHQ&data=02%7C01%7C%7Ccfbf241f75ab4f1656b908d7169b90f3%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637002729714345951&sdata=zfA8eaaoezuLK%2Blkh4qwEUs9obd%2BR2nXQTV5JdYrDHA%3D&reserved=0.

siddjain commented 5 years ago

ping.. any update on this?


From: Siddharth Jain siddjain@live.com Sent: Friday, August 9, 2019 11:06 AM To: asciidoctor/asciidoctor-mathematical reply@reply.github.com Subject: Re: [asciidoctor/asciidoctor-mathematical] gsub!': asciidoctor: FAILED to load AsciiDoc document - can't modify frozen String (FrozenError) (#56)

also this:

bash-4.4# ls /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-mathematical-0.3.1/lib asciidoctor-mathematical asciidoctor-mathematical.rb


From: Siddharth Jain siddjain@live.com Sent: Wednesday, August 7, 2019 4:39 PM To: asciidoctor/asciidoctor-mathematical reply@reply.github.com Subject: Re: [asciidoctor/asciidoctor-mathematical] gsub!': asciidoctor: FAILED to load AsciiDoc document - can't modify frozen String (FrozenError) (#56)

ping on this. any ETA when a new version will be released?


From: Zhang YANG notifications@github.com Sent: Thursday, August 1, 2019 9:16 AM To: asciidoctor/asciidoctor-mathematical asciidoctor-mathematical@noreply.github.com Cc: siddjain siddjain@live.com; Mention mention@noreply.github.com Subject: Re: [asciidoctor/asciidoctor-mathematical] gsub!': asciidoctor: FAILED to load AsciiDoc document - can't modify frozen String (FrozenError) (#56)

You will have to learn a bit docker and Google can help youl

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fasciidoctor%2Fasciidoctor-mathematical%2Fissues%2F56%3Femail_source%3Dnotifications%26email_token%3DAAFZEMOMMOSCTV774USMTL3QCMD4TA5CNFSM4IHVIYH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3LD2AQ%23issuecomment-517356802&data=02%7C01%7C%7Ccfbf241f75ab4f1656b908d7169b90f3%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637002729714335940&sdata=z8bOjzs4BjzCQoVQ1u0ZmQqH2y6s3T33AeVZDeaBk6o%3D&reserved=0, or mute the threadhttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAFZEMJN6SIX5BFJAN7PHOTQCMD4TANCNFSM4IHVIYHQ&data=02%7C01%7C%7Ccfbf241f75ab4f1656b908d7169b90f3%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637002729714345951&sdata=zfA8eaaoezuLK%2Blkh4qwEUs9obd%2BR2nXQTV5JdYrDHA%3D&reserved=0.

siddjain commented 4 years ago

is there any update on this? its been a while since this issue was raised.

mojavelinux commented 3 years ago

I have included a fix for this in #92.