7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

gem のディレクトリに一発 cd する

Last updated at Posted at 2012-05-13

今入ってるバージョンの gem のソースを確認したいときに。

% cd $(dirname $(gem which <gem>)) 

<gem> は正確には require するファイル名なので、期待したのと違うディレクトリに行ってしまうこともあるけれど、細かいことは気にしない。使うときはたいてい連打するハメになるので、シェル関数として定義してみたり。

.zshrc
cdgem () {
        cd $(dirname $(gem which $1))
}

pry が入っていれば pry に頼ればいいという話もあったりなかったり。

7
7
2

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
7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?