Error installing, running Fastlane for Flutter on mac
Based on this thread (thanks for @lwj Answer):
https://github.com/fastlane/fastlane/issues/15740
1- It might need to uninstall cask fastlane first:
brew cask uninstall fastlane
2- Then Install it using RubyGems:
sudo gem install fastlane -NV
Also because Apple has changed the default shell to zsh, referring to @fdg13gustav answer: https://stackoverflow.com/a/58310864/1995358
3- Create .zprofile
file in your home directory
And regarding this thread: https://github.com/fastlane/fastlane/issues/12609
4- Add these lines to your ~/.zprofile
file:
export PATH="$HOME/.fastlane/bin:$PATH"
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
Tanmay Pandharipande
Updated on December 16, 2022Comments
-
Tanmay Pandharipande over 1 year
Following the link Flutter Fastlane docs
Running command:
brew cask install fastlane
Returns:
Gems updated: slack-notifier atomos claide nanaimo xcodeproj rouge xcpretty terminal-notifier tty-screen tty-cursor tty-spinner commander-fastlane faraday faraday_middleware gh_inspector mini_magick rubyzip naturally simctl jwt memoist signet Gems already up-to-date: fastlane **ERROR: Error installing fastlane: signet requires Ruby version >= 2.4.0.** Cleaning up installed gems... Attempting to uninstall xcpretty-0.2.6 Successfully uninstalled xcpretty-0.2.6 Attempting to uninstall xcodeproj-1.4.4 Successfully uninstalled xcodeproj-1.4.4 Attempting to uninstall rubyzip-1.2.1 Successfully uninstalled rubyzip-1.2.1 Attempting to uninstall nanaimo-0.2.3 Successfully uninstalled nanaimo-0.2.3 Attempting to uninstall memoist-0.15.0 Successfully uninstalled memoist-0.15.0 Attempting to uninstall gh_inspector-1.0.3 Successfully uninstalled gh_inspector-1.0.3 Attempting to uninstall faraday_middleware-0.11.0.1 Successfully uninstalled faraday_middleware-0.11.0.1 Attempting to uninstall faraday-0.12.1 Successfully uninstalled faraday-0.12.1 Attempting to uninstall commander-fastlane-4.4.4 Successfully uninstalled commander-fastlane-4.4.4 Attempting to uninstall claide-1.0.1 Successfully uninstalled claide-1.0.1 Attempting to uninstall rouge-1.11.1 Successfully uninstalled rouge-1.11.1 Clean Up Complete Detected shell config file at path '~/.bash_profile' Please add the following line to your bash profile: export PATH="$HOME/.fastlane/bin:$PATH" **After doing so close the terminal session and restart it to start using fastlane 🚀 🍺 fastlane was successfully installed!**
which gave this output. But when I run
ruby -v
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin16]
I get this output. I added all the paths in .bash_profile and then I run
fastlane env
orfastlane init
inside the android/ folder or anywhere it is giving me this error/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/faraday-0.17.1/lib/faraday/error.rb:95:in <.module:Faraday>: superclass mismatch for class ConnectionFailed (TypeError) from /.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/faraday-0.17.1/lib/faraday/error.rb:6:in '<.top (required)>' from /.fastlane/bin/bundle/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in 'require' from /.fastlane/bin/bundle/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in 'require' from /.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/faraday-0.17.1/lib/faraday.rb:80:in 'block in require_libs' from /.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/faraday-0.17.1/lib/faraday.rb:79:in 'each' from /.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/faraday-0.17.1/lib/faraday.rb:79:in 'require_libs' from /.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/faraday-0.17.1/lib/faraday.rb:242:in '<.module:Faraday>' from /.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/faraday-0.17.1/lib/faraday.rb:16:in '<.top (required)>' from /.fastlane/bin/bundle/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in 'require' from /.fastlane/bin/bundle/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in 'require' from /.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.28.3/spaceship/lib/spaceship/client.rb:1:in '<.top (required)>' from /.fastlane/bin/bundle/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in 'require' from /.fastlane/bin/bundle/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in 'require' from /.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.28.3/spaceship/lib/spaceship.rb:3:in '<.top (required)>' from /.fastlane/bin/bundle/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in 'require' from /.fastlane/bin/bundle/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in 'require' from /.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.28.3/fastlane/lib/fastlane/setup/setup_ios.rb:1:in '<.top (required)>' from /.fastlane/bin/bundle/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in 'require' from /.fastlane/bin/bundle/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in 'require' from /.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.28.3/fastlane/lib/fastlane/setup/setup.rb:57:in '<.top (required)>' from /.fastlane/bin/bundle/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in 'require' from /.fastlane/bin/bundle/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in 'require' from /.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.28.3/fastlane/lib/fastlane.rb:10:in '<.top (required)>' from /.fastlane/bin/bundle/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in 'require' from /.fastlane/bin/bundle/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in 'require' from /.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.28.3/fastlane/lib/fastlane/cli_tools_distributor.rb:18:in 'take_off' from /.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.28.3/bin/fastlane:20:in '<.top (required)>' from /.fastlane/bin/bundle/bin/fastlane:22:in 'load' from /.fastlane/bin/bundle/bin/fastlane:22:in '<.main>'
After trying
sudo gem install fastlane
it saysSuccessfully installed fastlane-2.137.0 Parsing documentation for fastlane-2.137.0 Done installing documentation for fastlane after 6 seconds 1 gem installed
But when I again write
fastlane env
orfastlane init
it gives me same above error