Gemfileにパッチを当てる
--- Gemfile.orig 2024-03-14 15:15:40.075550000 +0900
+++ Gemfile 2024-04-02 11:45:11.655917000 +0900
@@ -1,14 +1,14 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
-ruby '3.3.0'
+ruby '3.3.0.preview2'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main'
gem 'rails', '~> 6.1.7', '>= 6.1.7.6'
# Use sqlite3 as the database for Active Record
gem 'sqlite3', '~> 1.4'
# Use Puma as the app server
-gem 'puma', '~> 5.0'
+gem 'puma'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
@@ -38,7 +38,7 @@
gem 'web-console', '>= 4.1.0'
# Display performance information such as SQL time and flame graphs for each request in your browser.
# Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md
- gem 'rack-mini-profiler', '~> 2.0'
+ gem 'rack-mini-profiler'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
@@ -53,3 +53,10 @@
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
+
+gem "webrick"
+
+gem "actionview-encoded_mail_to"
+
+gem "annotate"
+
app/assets/javascripts/application.jsの作成
//= require rails-ujs
app/views/layouts/application.html.erbに以下のパッチを当てる
--- app/views/layouts/application.html.erb.org 2024-02-28 09:38:49.000000000 +0900
+++ app/views/layouts/application.html.erb 2024-02-29 15:22:19.206660000 +0900
@@ -7,6 +7,7 @@
<%= csp_meta_tag %>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
+ <%= javascript_include_tag 'application' %>
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
</head>CSRFエラー対策
後日また… ;-)
`rake routes'をできるようにする
以下の内容のファイルを lib/tasks/routes.rake に置く
task routes: :environment do
Rails.application.eager_load!
models = ApplicationRecord.descendants.collect(&:name).join("|").downcase
controllers = ApplicationController.descendants.collect(&:name)
controllers = (controllers.map { |controller| controller[0..-11].downcase }).join("|")
if models
puts `bundle exec rails routes -g "#{models}|#{controllers}"`
else
puts `bundle exec rails routes -g "#{controllers}"`
end
end