Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When installing via homebrew it downloads version 2.28.3 instead of the latest version #15496

Closed
4 tasks done
Daniel-Griffiths opened this issue Oct 14, 2019 · 27 comments · Fixed by fastlane/packaged-fastlane#101
Assignees

Comments

@Daniel-Griffiths
Copy link

New Issue Checklist

Issue Description

When installing fastlane via homebrew using brew cask install fastlane it always downloads version 2.28.3

Installing via ruby gems using the command sudo gem install fastlane -NV it correctly installs the latest version.

Command executed
brew cask install fastlane

My OS is Mac OS Catalina

✅ fastlane environment ✅

Stack

Key Value
OS 10.15
Ruby 2.2.4
Bundler? false
Git git version 2.21.0 (Apple Git-122)
Installation Source ~/.fastlane/bin/bundle/bin/fastlane
Host Mac OS X 10.15 (19A583)
Ruby Lib Dir ~/.fastlane/bin/bundle/lib
OpenSSL Version OpenSSL 1.0.2g 1 Mar 2016
Is contained false
Is homebrew true
Is installed via Fabric.app false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 11.1

System Locale

Variable Value
LANG en_US.UTF-8
LC_ALL en_US.UTF-8
LANGUAGE en_US.UTF-8

fastlane files:

No Fastfile found

No Appfile found

fastlane gems

Gem Version Update-Status
fastlane 2.28.3 💥 Check failed

Loaded fastlane plugins:

No plugins Loaded

Loaded gems
Gem Version
slack-notifier 1.5.1
atomos 0.1.3
CFPropertyList 2.3.5
claide 1.0.3
colored2 3.1.2
nanaimo 0.2.6
xcodeproj 1.12.0
rouge 2.0.7
xcpretty 0.3.0
terminal-notifier 1.7.1
unicode-display_width 1.1.3
terminal-table 1.7.3
plist 3.2.0
public_suffix 2.0.5
addressable 2.5.1
multipart-post 2.0.0
word_wrap 1.0.0
tty-screen 0.5.0
babosa 1.0.2
colored 1.2
highline 1.7.8
commander-fastlane 4.4.6
excon 0.55.0
faraday 0.12.1
unf_ext 0.0.7.4
unf 0.1.4
domain_name 0.5.20170404
http-cookie 1.0.3
faraday-cookie_jar 0.0.6
fastimage 2.1.0
gh_inspector 1.1.3
uber 0.0.15
representable 2.3.0
retriable 2.1.0
mime-types-data 3.2016.0521
mime-types 3.1
hurley 0.2
little-plugger 1.1.4
multi_json 1.12.1
logging 2.2.2
jwt 1.5.6
memoist 0.16.0
os 0.9.6
signet 0.7.3
googleauth 0.5.1
httpclient 2.8.3
google-api-client 0.9.28
json 1.8.1
mini_magick 4.5.1
multi_xml 0.6.0
rubyzip 1.3.0
security 0.1.3
xcpretty-travis-formatter 0.0.4
dotenv 2.2.0
bundler 1.14.6
faraday_middleware 0.11.0.1

generated on: 2019-10-10

@Daniel-Griffiths Daniel-Griffiths changed the title When installing from brew it downloads version 2.28.3 instead of the latest version When installing via homebrew it downloads version 2.28.3 instead of the latest version Oct 14, 2019
@regularberry
Copy link

Thanks for this. I couldn't figure out why my fresh install of fastlane was failing with the error: [!] undefined method `each' for nil:NilClass

But installing from ruby gems instead of brew made it work 👍

@janpio
Copy link
Member

janpio commented Oct 17, 2019

cc @joshdholtz

@garylai
Copy link

garylai commented Nov 4, 2019

I think it is because one of the dependencies fails to update:

ERROR:  Error installing fastlane:
	signet requires Ruby version >= 2.4.0.

The brew package seems to be still using ruby 2.2?

@joypatel04
Copy link

@joshdholtz @janpio Any update on this issue?

@joshdholtz
Copy link
Member

Looking into! Will update when I have more info

@joshdholtz joshdholtz self-assigned this Nov 4, 2019
@nickrnet
Copy link

nickrnet commented Nov 4, 2019

@joshdholtz Here's what I'm getting on my up-to-date Mojave machine.
brew-cask-install-fastlane.txt

@algera
Copy link

algera commented Nov 7, 2019

Here is what I am using as a temporary workaround while this Homebrew installation issue is being considered.

Note: I could not install via gems b/c of the organization of Xcode 11 w/ Mojave. In order to correct that setup and get on Fastlane 2.134.0. If you are using a later version of MacOS, consider updating the command line tools executable package command.

Trash existing homebrew installation

brew cask uninstall fastlane

Reinstall header files on Mac

sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install
sudo xcodebuild -license accept
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

Now update Ruby to v2.6.5 as Ruby v2.3 (default on Mojave) will not work with Fastlane

brew update
brew install ruby-build
brew install rbenv
rbenv install 2.6.5
rbenv global 2.6.5
export PATH="$HOME/.rbenv/shims:$PATH"
sudo gem install fastlane -NV

@Katsz
Copy link
Contributor

Katsz commented Nov 7, 2019

Due to enormous amount of people used to install all the things via homebrew maybe we should just prune all fastlane versions <= 2.28 from it?
I don't think there is a single person in the wild that uses 2.28 consciously.

@Larusso
Copy link

Larusso commented Nov 14, 2019

@Katsz How do you want to do that. It's an unversioned cask. It downloads a zip file from this unversioned URL https://fastlane.tools/fastlane.zip

@joshdholtz
Copy link
Member

Heyyyy 👋 I'm currently working on a PR for this!

Problem

  • Packaged fastlane used Ruby 2.2 which is too old for some fastlane dependencies and causes installation issues leading to packaged fastlane installed version 2.28.3
  • Packaged fastlane can also only be built/repackaged on OSX 10.1

Solution

  • Build new packaged fastlane with Ruby 2.4 on Catalina
  • Ruby will also be built on the during the installation process (if not already installed)
    • This makes packaged fastlane smaller but the first install longer

We are still undergoing some testing but my goal is to get it released next week 🤞 If anybody is willing to help test this please let me know!

@Katsz
Copy link
Contributor

Katsz commented Nov 14, 2019

@Larusso my bad, wasn't aware fastlane is cask'ed

@Larusso
Copy link

Larusso commented Nov 14, 2019

@joshdholtz I tried it out and it failed for me. With the changes you propose you should also think about moving the whole thing into a brew formular. Because installing ruby etc during installation time is not really what brew cask is for.

@joshdholtz
Copy link
Member

@Larusso I'll look into! I'm not a fan of my changes I made with install Ruby but it "works" 😬 I'll look into this 😊

@joypatel04
Copy link

@joshdholtz Will your changes work on macOS Mojave?

I am still running on Mojave to avoid issues (If there is any) running with React-native.

@joshdholtz
Copy link
Member

Yup yup! It will 😊 I have both a Catalina and Mojave machine that I’m testing this on

@nickrnet
Copy link

Any updates on this? I'm needing to get 2.136 or greater because of #14573

@chrisvire
Copy link

Our product uses fastlane and depends on installing fastlane via https://fastlane.tools/fastlane.zip. Will that distribution mechanism be updated so that it can be updated to latest fastlane instead of being stuck on 2.28.3? Just an FYI that this isn't limited to homebrew.

@janpio
Copy link
Member

janpio commented Nov 27, 2019

Thanks for this context @chrisvire, @joshdholtz is working on fixing this.

@Larusso
Copy link

Larusso commented Nov 28, 2019

For anyone not able to wait for the official fix. I added some fixes/customization to the pull request from @joshdholtz. Some of the changes are tailored for my needs and preferences.
You can find the diff here:
wooga/packaged-fastlane@6e591d7

In short:

  • removed all prompts (I have no user input at install time)
  • update the shim script so I can symlink the file to /usr/local/bin (I did this for my custom cask file)
  • removed the brew openssl installation since ruby-build will download the correct openssl version (I have no idea why some random version from brew is the preferred solution?)
  • changed the install path to install to the current dir (I did this for my custom cask file and I don't like programs in the home directory)

I adjusted my custom cask file which can be found here:
https://github.com/wooga/homebrew-tools/blob/master/Casks/fastlane.rb

I'm running with this fix the last couple of days and everything works so far for me.
I hope this might be of help for anyone.

@joshdholtz
Copy link
Member

@Larusso That is great! Do you mind making a PR into my PR for that? That would be so 💯

@Larusso
Copy link

Larusso commented Nov 28, 2019

@joshdholtz I'll take it without my custom modifications with the install path?

@joshdholtz
Copy link
Member

@joshdholtz Yeah yeah, sorry! I should have mentioned that. Not enough coffee yet 🙃 I appreciate all your testing on this and want to make sure that you get credit for your changes/time as well. I got sidetracked with some other fixes that needed to get made but this is now number 1 priority

@joshdholtz
Copy link
Member

Hey, everyone! This is all fixed now 😊

So...

  1. The brew cask install fastlane is no longer a thing
  2. The homebrew install of fastlane has been migrated to a formula which means:
    • Uninstall cask brew cask uninstall fastlane
    • Remove any fastlane cask stuff from you path (.bash_profile, .bashrc, .zshrc, etc)
  3. Run brew install fastlane
    • This depends on homebrew version of openssl and ruby 2.5 so things should be 💯 and install quickly
    • This new method won't autoupdate (which was a bit confusing, IMO) so you will need to run brew upgrade fastlane when new versions drop

This is ready to go as of this morning 😊 There will be official announcements, docs, and migration notes coming out later 💪

Sorry about this taking so long 😇 It was quite an adventure.

Ping me if anybody has any questions!

@chrisvire
Copy link

chrisvire commented Dec 12, 2019

@joshdholtz Does this also fix installing using https://fastlane.tools/fastlane.zip?

Our software uses fastlane and downloads from that url.

@joshdholtz
Copy link
Member

@chrisvire That zip file is actually going to be removed here soon 😇 That was the cause of all the problem because it was being bundled with an old version of Ruby and the way that that was designed does not work well with newer versions of Ruby. I'm not exactly sure how your systems work but I would recommend using brew install fastlane or pulling down the fastlane from source and running gem build fastlane.gemspec and installing the gem that that builds.

@chrisvire
Copy link

We can’t require a dependency on homebrew. We need the zip distribution that includes ruby.

@patelhiren
Copy link

@joshdholtz Running brew install fastlane installed the latest available version. However running a lane that uses the gym command was failing. Turned out xcpretty was not installed via the brew command. I manually installed via sudo gem install xcpretty. The error went away after that. Anyway to automate the xcpretty install when installed via homebrew?

@janpio janpio unpinned this issue Dec 26, 2019
jakubknejzlik added a commit to jakubknejzlik/docs that referenced this issue Jan 2, 2020
Cask version installs pretty old version (2.28.3) and according to this issue: fastlane/fastlane#15496 theres also `brew install fastlane` which installs latest version.
alexrepty added a commit to alexrepty/docs that referenced this issue Jan 8, 2020
According to [this note](fastlane/fastlane#15496 (comment)) by @joshdholtz, the old method of using `brew cask install fastlane` doesn't work anymore, as it installs an old version. The currently supported way is `brew install fastlane` (sans `cask`), which is not reflected in the docs just yet.
serragnoli added a commit to serragnoli/website that referenced this issue Jan 8, 2020
legalcodes added a commit to flutter/website that referenced this issue Jan 9, 2020
* Update cd.md

Updating doc as per fastlane/fastlane#15496 (comment)

* Update src/docs/deployment/cd.md

Co-Authored-By: Jon Tippens <legalcodes@users.noreply.github.com>

Co-authored-by: Jon Tippens <legalcodes@users.noreply.github.com>
@fastlane fastlane locked and limited conversation to collaborators Feb 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.