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

rake guides:generate:html fails since 72abd6357d7909c15a460c716840159e5bb97ac7 #47433

Closed
yahonda opened this issue Feb 20, 2023 · 3 comments · Fixed by #47445
Closed

rake guides:generate:html fails since 72abd6357d7909c15a460c716840159e5bb97ac7 #47433

yahonda opened this issue Feb 20, 2023 · 3 comments · Fixed by #47445

Comments

@yahonda
Copy link
Member

yahonda commented Feb 20, 2023

rake guides:generate:html fails since 72abd63 #47347

Reported at Rails Discord https://discord.com/channels/849034466856665118/974005005768069211/1076871087075381339 by @vipulnsward

Steps to reproduce

git clone https://github.com/rails/rails
cd rails/guides
bundle install
rm -rf output ; bundle exec rake guides:generate:html

Expected behavior

It should generate Rails Guide in HTML.

Actual behavior

$ rm -rf output ; bundle exec rake guides:generate:html
/home/yahonda/.rbenv/versions/3.2.1/bin/ruby -Eutf-8:utf-8 rails_guides.rb
Generating action_text_overview.md as action_text_overview.html
/home/yahonda/src/github.com/rails/rails/guides/rails_guides/markdown.rb:65: warning: undefining the allocator of T_DATA class Redcarpet::Markdown
Generating association_basics.md as association_basics.html
/home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/base.rb:264:in `public_send': undefined method `__home_yahonda_src_github_com_rails_rails_guides_source_layout_html_erb___2200547860019096587_6160' for #<ActionView::Base:0x00000000003098> (ActionView::Template::Error)
	from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/base.rb:264:in `_run'
	from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/template.rb:195:in `block in render'
	from /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/notifications.rb:208:in `instrument'
	from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/template.rb:484:in `instrument_render_template'
	from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/template.rb:189:in `render'
	from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/template_renderer.rb:77:in `block in render_with_layout'
	from /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/notifications.rb:206:in `block in instrument'
	from /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/notifications/instrumenter.rb:58:in `instrument'
	from /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/notifications.rb:206:in `instrument'
	from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/template_renderer.rb:75:in `render_with_layout'
	from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/template_renderer.rb:59:in `render_template'
	from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/template_renderer.rb:11:in `render'
	from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/renderer.rb:61:in `render_template_to_object'
	from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/renderer.rb:29:in `render_to_object'
	from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/renderer.rb:22:in `render'
	from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/helpers/rendering_helper.rb:37:in `block in render'
	from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/base.rb:291:in `in_rendering_context'
	from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/helpers/rendering_helper.rb:33:in `render'
	from /home/yahonda/src/github.com/rails/rails/guides/rails_guides/markdown.rb:181:in `render_page'
	from /home/yahonda/src/github.com/rails/rails/guides/rails_guides/markdown.rb:31:in `render'
	from /home/yahonda/src/github.com/rails/rails/guides/rails_guides/generator.rb:160:in `generate_guide'
	from /home/yahonda/src/github.com/rails/rails/guides/rails_guides/generator.rb:85:in `block in generate_guides'
	from /home/yahonda/src/github.com/rails/rails/guides/rails_guides/generator.rb:83:in `each'
	from /home/yahonda/src/github.com/rails/rails/guides/rails_guides/generator.rb:83:in `generate_guides'
	from /home/yahonda/src/github.com/rails/rails/guides/rails_guides/generator.rb:40:in `generate'
	from rails_guides.rb:30:in `<main>'
/home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/base.rb:264:in `public_send': undefined method `__home_yahonda_src_github_com_rails_rails_guides_source_layout_html_erb___2200547860019096587_6160' for #<ActionView::Base:0x00000000003098> (NoMethodError)

        public_send(method, locals, buffer, &block)
        ^^^^^^^^^^^
	from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/base.rb:264:in `_run'
	from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/template.rb:195:in `block in render'
	from /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/notifications.rb:208:in `instrument'
	from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/template.rb:484:in `instrument_render_template'
	from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/template.rb:189:in `render'
	from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/template_renderer.rb:77:in `block in render_with_layout'
	from /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/notifications.rb:206:in `block in instrument'
	from /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/notifications/instrumenter.rb:58:in `instrument'
	from /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/notifications.rb:206:in `instrument'
	from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/template_renderer.rb:75:in `render_with_layout'
	from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/template_renderer.rb:59:in `render_template'
	from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/template_renderer.rb:11:in `render'
	from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/renderer.rb:61:in `render_template_to_object'
	from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/renderer.rb:29:in `render_to_object'
	from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/renderer.rb:22:in `render'
	from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/helpers/rendering_helper.rb:37:in `block in render'
	from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/base.rb:291:in `in_rendering_context'
	from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/helpers/rendering_helper.rb:33:in `render'
	from /home/yahonda/src/github.com/rails/rails/guides/rails_guides/markdown.rb:181:in `render_page'
	from /home/yahonda/src/github.com/rails/rails/guides/rails_guides/markdown.rb:31:in `render'
	from /home/yahonda/src/github.com/rails/rails/guides/rails_guides/generator.rb:160:in `generate_guide'
	from /home/yahonda/src/github.com/rails/rails/guides/rails_guides/generator.rb:85:in `block in generate_guides'
	from /home/yahonda/src/github.com/rails/rails/guides/rails_guides/generator.rb:83:in `each'
	from /home/yahonda/src/github.com/rails/rails/guides/rails_guides/generator.rb:83:in `generate_guides'
	from /home/yahonda/src/github.com/rails/rails/guides/rails_guides/generator.rb:40:in `generate'
	from rails_guides.rb:30:in `<main>'
rake aborted!
Command failed with status (1): [/home/yahonda/.rbenv/versions/3.2.1/bin/ru...]
/home/yahonda/src/github.com/rails/rails/guides/Rakefile:10:in `block (3 levels) in <top (required)>'
/home/yahonda/.rbenv/versions/3.2.1/bin/bundle:25:in `load'
/home/yahonda/.rbenv/versions/3.2.1/bin/bundle:25:in `<main>'
Tasks: TOP => guides:generate:html
(See full trace by running task with --trace)
$

System configuration

Rails version: main branch including 72abd63

Ruby version: ruby 3.2.1 (2023-02-08 revision 31819e82c8) [x86_64-linux]

@zzak
Copy link
Member

zzak commented Feb 20, 2023

Looked into this for about an hour, I think we shouldn't be using private ActionView API like this:

view = ActionView::Base.with_empty_template_cache.with_view_paths(
[@source_dir],
edge: @edge,
version: @version,
epub: "epub/#{epub_filename}",
language: @language,
direction: @direction,
uuid: SecureRandom.uuid
)
view.extend(Helpers)

I think if we want to rewrite this part, e.g. using vanilla ERB or similar, that may take some effort but could be healthier in the long run.

@ioquatix
Copy link
Contributor

Thanks for your investigation.

@zzak
Copy link
Member

zzak commented Feb 20, 2023

Just added #47439 which has one hack I tried briefly to get the build green again, open if anyone wants to try and fix it up!

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

Successfully merging a pull request may close this issue.

3 participants