例: vendor/bundleをパスとしてbundle installしたrailtiesの特定ファイルのパスを確認したい
↓
$ bundle exec gem contents railties | grep rails/commands.rb
/home/yu_uchida/my_app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.3/lib/rails/commands.rb
comannds.rbの中身を見たいときは
↓
$ cat `bundle exec gem contents railties | grep rails/commands.rb`
# frozen_string_literal: true
require "rails/command"
aliases = {
"g" => "generate",
"d" => "destroy",
"c" => "console",
"s" => "server",
"db" => "dbconsole",
"r" => "runner",
"t" => "test"
}
command = ARGV.shift
command = aliases[command] || command
Rails::Command.invoke command, ARGV