Are you sure you want to delete the question?

If your question is resolved, you may close it.

Leaving a resolved question undeleted may help others!

We hope you find it useful!

Rails でルーティングの確認をする際に grep が使えない

解決したいこと

プログラミング初心者でrails勉強中です。

ターミナルでルーティングの絞り込み確認をしたいのですが・・・
rails routes | grep user
と入れると以下のエラーがはかれます。

発生している問題・エラー

grep : The term 'grep' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:16
+ rails routes | grep user
    + CategoryInfo          : ObjectNotFound: (grep:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

以下環境
ruby 2.7.0
Rails 6.0.3.2
win10
xcode version: 1.60.0

自分で試したこと

ググっては見たのですが、それらしきものを見つけられませんでした。。
知恵をお借りできると幸いです。

0 likes

2Answer

生のwindowsにはgrepというコマンドはないはず。

WSL2とかcygwinとかなら

$ rails routes | grep graphql
                  graphql POST /graphql(.:format)

またはpry-railsを入れて

$ rails c
> show-routes -G graphql
                  graphql POST /graphql(.:format)
0Like

Comments

  1. @kutigakusai

    Questioner

    ありがとうございます!!
    助かります!

Comments

  1. @kutigakusai

    Questioner

    いけました!
    ありがとうございます!

Your answer might help someone💌