0
0

More than 1 year has passed since last update.

インストール済みgemの特定ファイルの絶対パス確認方法

Last updated at Posted at 2022-02-07

例: 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
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0