Skip to content

Instantly share code, notes, and snippets.

@desnudopenguino
Last active July 9, 2023 21:49
Show Gist options
  • Save desnudopenguino/b3d4135df089eeeddfe62908aa35d987 to your computer and use it in GitHub Desktop.
Save desnudopenguino/b3d4135df089eeeddfe62908aa35d987 to your computer and use it in GitHub Desktop.
stack trace for using a method for inject_irb
<% @page_title = "All Tasks" %>
<h2>Tasks</h2>
<ul>
<% @tasks.each do |task| %>
<li class="<%= task.done? ? :done : :todo %>">
<input type="checkbox"<%= " checked" if task.done? %>>
<%= task.title %>
</li>
<% end %>
</ul>
<%
def try_it(&block)
inject_erb catpure_erb(&block).capitalize
end
%>
<% try_it do %>
words
<% end %>
NoMethodError: undefined method `try_it' for #<App:0x0000000806b9acb8 @_request=#<App::RodaRequest GET />, @_response=#<App::RodaResponse nil {} []>, @tasks=[#<Task:0x0000000806b98da0 @done=true, @title="clean kitchen", @due=#<Date: 2023-07-09 ((2460135j,0s,0n),+0s,2299161j)>>, #<Task:0x0000000806b98d28 @done=true, @title="wash car", @due=#<Date: 2023-07-29 ((2460155j,0s,0n),+0s,2299161j)>>, #<Task:0x0000000806b98c60 @done=false, @title="mow lawn", @due=#<Date: 2023-07-04 ((2460130j,0s,0n),+0s,2299161j)>>], @_out_buf=nil, @page_title="All Tasks"> (NoMethodError)
/usr/home/bucky/my_app/views/tasks.erb:18:in `__tilt_880'
/usr/home/bucky/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/tilt-2.2.0/lib/tilt/template.rb:211:in `bind_call'
/usr/home/bucky/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/tilt-2.2.0/lib/tilt/template.rb:211:in `evaluate'
/usr/home/bucky/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/tilt-2.2.0/lib/tilt/template.rb:104:in `render'
/usr/home/bucky/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/roda-3.67.0/lib/roda/plugins/render.rb:339:in `render'
/usr/home/bucky/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/roda-3.67.0/lib/roda/plugins/render.rb:500:in `render'
/usr/home/bucky/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/roda-3.67.0/lib/roda/plugins/render.rb:534:in `view'
/usr/home/bucky/my_app/app.rb:41:in `block (2 levels) in <class:App>'
/usr/home/bucky/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/roda-3.67.0/lib/roda/request.rb:536:in `always'
/usr/home/bucky/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/roda-3.67.0/lib/roda/request.rb:368:in `root'
/usr/home/bucky/my_app/app.rb:38:in `block in <class:App>'
/usr/home/bucky/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/roda-3.67.0/lib/roda.rb:518:in `_roda_run_main_route'
/usr/home/bucky/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/roda-3.67.0/lib/roda.rb:496:in `block in _roda_handle_main_route'
/usr/home/bucky/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/roda-3.67.0/lib/roda.rb:494:in `catch'
/usr/home/bucky/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/roda-3.67.0/lib/roda.rb:494:in `_roda_handle_main_route'
/usr/home/bucky/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/roda-3.67.0/lib/roda.rb:380:in `block in base_rack_app_callable'
/usr/home/bucky/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rack-3.0.7/lib/rack/tempfile_reaper.rb:20:in `call'
/usr/home/bucky/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rack-3.0.7/lib/rack/lint.rb:63:in `response'
/usr/home/bucky/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rack-3.0.7/lib/rack/lint.rb:35:in `call'
/usr/home/bucky/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rack-3.0.7/lib/rack/show_exceptions.rb:27:in `call'
/usr/home/bucky/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rack-3.0.7/lib/rack/common_logger.rb:43:in `call'
/usr/home/bucky/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rack-3.0.7/lib/rack/content_length.rb:20:in `call'
/usr/home/bucky/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/puma-6.2.2/lib/puma/configuration.rb:270:in `call'
/usr/home/bucky/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/puma-6.2.2/lib/puma/request.rb:98:in `block in handle_request'
/usr/home/bucky/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/puma-6.2.2/lib/puma/thread_pool.rb:340:in `with_force_shutdown'
/usr/home/bucky/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/puma-6.2.2/lib/puma/request.rb:97:in `handle_request'
/usr/home/bucky/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/puma-6.2.2/lib/puma/server.rb:431:in `process_client'
/usr/home/bucky/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/puma-6.2.2/lib/puma/server.rb:233:in `block in run'
/usr/home/bucky/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/puma-6.2.2/lib/puma/thread_pool.rb:147:in `block in spawn_thread'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment