コンテナに入って以下を実行することで、動作するようになりました。
bundle install --with migrations
問題は、Rakeタスク rake ai:embeddings:backfill が以下を実行することです。
Parallel.each(topics.all, in_processes: args[:concurrency].to_i, progress: "Topics") do |t|
ActiveRecord::Base.connection_pool.with_connection do
vector_rep.generate_representation_from(t)
end
end
これには ruby-progressbar をロードする必要がありますが、Gemfileのmigrationsグループにあるため無視されます。