要点
環境構築で、bundle経由でfastlane等をinstallしたが、
$ bundle exec fastlane dev
を叩いたところ、command not found
とerrorが出た。
bundle 2.1.0による問題らしいが、それを知らずに自己解決した話。
同じ問題にぶち当たって、解決方法を求めている人は、maybe resolved
、advice1
、advice2
あたりだけ見ればいいと思う。
ready
さぁ環境構築しよう!
$ bundle install
・・・
Bundle complete! 3 Gemfile dependencies, 90 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
よし成功だ!
deploy
開発したので、bundle経由で入れたfastlaneで配信するぞ!
$ bundle exec fastlane dev
・・・
bundler: command not found: fastlane
Install missing gem executables with `bundle install`
はっ?
なんでー?どうしてー?
$ bundle list
Gems included by the bundle:
・・・
* fastimage (2.1.7)
* fastlane (2.134.0)
* fourflusher (2.3.1)
・・・
Use `bundle info` to print more detailed information about a gem
ちゃんとあるじゃん?でもコマンド叩くとcommand not found
ってでるじゃん?
maybe resolved
もう普通にgem install fastlane
したりとか色々ググって出たものをかたっぱしから試したけど解決しないの。
最終的にRubyのversionか?Catalinaが悪いか?systemのRuby使ってるのがいかんのか?とか思って、次のコマンドの順で叩いてたぶん解決した。(たぶんというのは、fastlaneで別のエラー出て、他の作業をやり始めたので、deployされるまで確認していないため。)
長いのでコマンドだけ羅列していく。
$ brew install brew install rbenv ruby-build
$ rbenv install 2.6.5
$ rbenv global 2.6.5
$ rbenv exec gem install bundler
$ rbenv rehash
$ rbenv exec bundle install
$ rbenv exec bundle exec fastlane dev
・・・
[✔] 🚀
[11:11:10]: ----------------------------------------
[11:11:10]: --- Step: Verifying fastlane version ---
[11:11:10]: ----------------------------------------
[11:11:10]: Your fastlane version 2.134.0 matches the minimum requirement of 2.68.0 ✅
[11:11:10]: ------------------------------
[11:11:10]: --- Step: default_platform ---
[11:11:10]: ------------------------------
[11:11:10]: Driving the lane 'ios dev' 🚀
[11:11:10]: -----------------------
[11:11:10]: --- Step: cocoapods ---
[11:11:10]: -----------------------
・・・
ζ*'ヮ')ζ < キマシタワァ!
advice1
どうもbundleの最新版2.1.0に問題があるらしい…
それをたまたま踏み抜いてた模様。
<追記#2019-12-18_12:45>
・ bundler version 1.17.3でも自分の環境では同様に発生しているので、versionが問題ではなさそう。
bundleが入ってない状態から入れて起きたし、アップデートしたわけじゃないから気づくの無理っす。
ただ、bundleのissueは見逃していた気がするので、issue建てにいくか見に行けよってのが最短だったかもしれない。疑わしいとこ多すぎるのもつらいな。
advice2
bundlerのversionが問題なら、version下げたものをinstallしたらいいじゃん。との助言。
自分の環境は色々ためしすぎたせいか、gem install bundler:2.0.0
とかだとPermission errorが出て、sudo gem install bundler:2.0.0 -n /usr/local/bin
でローカル環境にinstalは
成功するのだけど、bundle --version
でversion確認すると2.1.0
って出てうまく入らない…。
bundleをuninstallしてからやれば上手くいくのだろうか?