如果您使用的是 Bootstrap v4(已标记),那么您的类名错误。
尝试这个:
<div class="custom-control custom-switch">
<%= sched.check_box :closed, {checked: sched.object.persisted?}, false, true, class: 'custom-control-input', id: 'flexSwitchCheckDefault' %>
<%= sched.label :closed, day[:label], class: 'custom-control-label', for: 'flexSwitchCheckDefault' %>
</div>
https://getbootstrap.com/docs/4.6/components/forms/#switches
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="customSwitch1">
<label class="custom-control-label" for="customSwitch1">v4 switch element</label>
</div>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="flexSwitchCheckChecked" checked>
<label class="form-check-label" for="flexSwitchCheckChecked">v5 switch element</label>
</div>