3

I've updated to Ruby 2.5.5 via rvm but I continue to get warnings from Fastlane. For context, I'm building an iOS app on Max OSX and I installed Fastlane via homebrew, brew cask install fastlane. I searched online and in the github repo for Fastlane, but couldn't really find a solution.

$ ruby -v
ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-darwin18]

And here is the Fastlane output enter image description here

There is a ruby 2.2.4 located here, which I am presuming Fastlane is using, but it's not clear to me what the proper way to upgrade this is or if there is some environment variable I can set so that Fastlane picks up the newer version.

~/.fastlane/bin/bundle/bin/ruby -v
ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-darwin15]

How can I get Fastlane to pick up the right version of Ruby?

Alternatively, are these warnings safe to ignore?

EDIT: Here is my fastlane env stack

| --------------------------- | ------------------------------------------- |
| OS                          | 10.14.6                                     |
| Ruby                        | 2.2.4                                       |
| Bundler?                    | false                                       |
| Git                         | git version 2.22.0                          |
| Installation Source         | ~/.fastlane/bin/bundle/bin/fastlane         |
| Host                        | Mac OS X 10.14.6 (18G87)                    |
| 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               | 10.3                                        |
blueether
  • 3,666
  • 4
  • 26
  • 32
  • 2
    What does `fastlane env` give you? That should show where Fastlane is at least looking for Ruby. – CodeBender Aug 19 '19 at 16:38
  • 1
    And how are you executing your lane - what command are you running? – janpio Aug 19 '19 at 16:40
  • I added the `fastlane env` above. I'm running `fastlane ios alpha`, `alpha` is the name of my lane as defined in my Fastfile. Did that answer your question? – blueether Aug 19 '19 at 16:46
  • It's my understanding that the Homebrew installation method bundles that version of Ruby. Have you tried uninstalling from Homebrew and reinstalling using RubyGems? https://github.com/fastlane/fastlane/issues/14212 – eeekari Aug 19 '19 at 17:02
  • @eeekari I haven't tried that, I was hoping to get it to work via homebrew. I'll give it a try – blueether Aug 20 '19 at 01:51
  • 1
    You either manage Ruby with Homebrew or with RVM - they don't mix. – Amadan Aug 20 '19 at 04:00
  • Here is what I did for fresh install: https://stackoverflow.com/a/62677836/4185100 – Jijo John Jul 01 '20 at 13:33

2 Answers2

1

When you install fastlane via homebrew it includes its own version of ruby, as you've seen. But if you install fastlane through gem install fastlane it'll pick up the version of ruby from rvm. So the solution in this case is to uninstall fastlane and reinstall it as a gem. Once you've done that you can run fastlane env again and you should see it picking up the expected ruby version.

Thanks to the people on this thread for the answer.

Hope that helps.

Paul
  • 1,897
  • 1
  • 14
  • 28
0

I spent the last few days with this because it would not update fastlane and this is how I was able to fix it. Here is what I found and what I did that worked for me

Using the sudo command to run install with the gem command puts it into the the usr/local/bin folder and you have to have root privileges to update fastlane and you don't want that. Brew bundles an incorrect version of ruby that won't let you update, either. I ended up with two installations that I needed to get rid of and then get things done the correct way. I am running Catalina so I needed to change my ~/.zshrc file, but I assume changing ~/.profile or ~/.bash_profile should do the same for older version of OSX.

You may not have to do all of this, I was angry yesterday and ended up with multiple installs. Just be aware if some of these things don't exist or error out.

Here is what I did:

I uninstalled fastlane from brew brew cask uninstall fastlane

I then went into my user folder and deleted the .fastlane folder

I ran fastlane env to catch my second install and looked at the Installation Source and deleted the fastlane command from that location.

I then ran fastlane and got No Command Found

Now edit your bash or zshrc file to add

export PATH=$PATH:~/.gems/bin
export GEM_HOME=~/.gems

save, close and restart the terminal

run gem install fastlane -NV. DO NOT USE SUDO! It installs back to usr/local/bin and you don't want that. fastlane can't update if you do

once the install finishes, run fastlane env and make sure the Install Location is in ~/.gems/.. and if you want, run fastlane update_fastlane to make sure you get the Nothing to Update message instead of a waring about needing sudo.

Hopefully this works or helps someone else.