#58779·rails

ActionView::Template::Error (wrong number of arguments (given 2, expected 1))

Author: cj-1010-1414Created Sep 16, 2026Updated Sep 17, 2026

I am using Ruby 4.0.6 and Rails 8.1.3.1.

I am following Rails' tutorial. Hitting Step 10, Controllers & Actions, I got this error on my view, resulting HTTP 500

ActionView::Template::Error (wrong number of arguments (given 2, expected 1))
Caused by: ArgumentError (wrong number of arguments (given 2, expected 1))

Information for: ActionView::Template::Error (wrong number of arguments (given 2, expected 1)):
     7:     <meta name="application-name" content="Learn Rails">
     8:     <meta name="mobile-web-app-capable" content="yes">
     9:     <%= csrf_meta_tags %>
    10:     <%= csp_meta_tag %>
    11: 
    12:     <%= yield :head %>
    13: 
  
app/views/layouts/application.html.erb:10

Information for cause: ArgumentError (wrong number of arguments (given 2, expected 1)):
  
app/views/layouts/application.html.erb:10
Started GET "/favicon.ico" for 127.0.0.1 at 2026-09-16 10:03:57 +0700
  
ActionController::RoutingError (No route matches [GET] "/favicon.ico"):

But everytime I cleaned the browser's data. I doesn't error. It works like what the tutorials tell.

So far, my temporary solution is to comment these lines at app/views/layouts/application.html.erb:

    <%#= csrf_meta_tags %>
    <%#= csp_meta_tag %>