やりたいこと
Bundlerを使っていて起動する時に
$ bundle exec fastlane --version
とするのが面倒なので
単に
$ fastlane --version
で起動させられるようにしたい。
やったこと
1. rbenv-binstubsをインストールする
$ brew install rbenv-binstubs
2. 各プロジェクト(リポジトリ)にbinstubsを設定する
$ bundle binstubs fastlane --path .bundle/bin
$ rbenv rehash
以下でもうまくいったがdeprecatedであるため非推奨:
$ bundle install --binstubs .bundle/bin
$ rbenv rehash
3. 確認する
$ which fastlane
/Users/foobarbaz/.rbenv/shims/fastlane
$ rbenv which fastlane
/path/to/your/repos/.bundle/bin/fastlane
のようにpathが出力されればshimsとpathが通っている
$ fastlane --version
fastlane 2.154.0
このように bundle exe
なしで起動したらOK。
うまくいった環境
macOS 10.15.6
Ruby 2.7.1
rbenv 1.1.2
Homebrew 2.4.9
fastlane 2.154.0
iterm 3.3.12
参考資料