Fastlane fails on Jenkins google-api-client-0.38.0 requires ruby version ~> 2.4 - ruby

As a proof of concept, I successfully built a local Jenkins server on my MacBook (MacOS is Catalina) and the pipeline uses Fastlane scripts to clone, build, and distribute successfully.
Now, I have a Mac Server in our Data Center and I completed the same build-out and installed Jenkins. When I run the same pipeline, it fails, so I tried executing from the command line and it fails with this error:
google-api-client-0.38.0 requires ruby version ~> 2.4
Apparently, my install used ruby 3.0, so I followed recommendations to install rbenv and down level to 2.4. the installers were successful, but still the problem persists and uses ruby 3.0. The paths defined in my profiles look correct.
There are two key differences between my local server and the server in the data center that I can think of that may be influencing this problem:
My MacBook was upgraded to Catalina where the DataCenter iMac was built factory-fresh with Catalina. Note that an Apple version of ruby is installed with Catalina.
I do not have Xcode installed, only the CLI xcode-select version 2373; I would like to keep the IDEs off of this server, so there isn't a temptation to fix code on this dedicated Jenkins server.
Any recommendations to further troubleshoot this installation?

First, you probably will have to install Xcode, to use all of its tools (the CLI won't cut it). I recommend xcode-install to manage xcode versions via CLI. That is one key difference in your setup.
However, there're probably shenanigans with your $PATH environment within Jenkins. From what I understood from your description, you were able to run fastlane normally by invoking it via Terminal, but it won't work in Jenkins, is that right? Check the $PATH in Jenkins and make sure it matches the $PATH in your Terminal. rbenv and other ruby version managers require you to execute some startup code (e.g. eval "$(rbenv init -)" in case of rbenv) before being able to use it, and then setting up the right $PATH is required to make everything work as expected (i.e. have it point at Ruby 2.4 instead of 3.0).

Related

Google Cloud SDK v274.0.0 update asking for Python 2.7 interpreter on a machine that has only ever had Python 3+ (Windows)

This is really strange - I've found no help in the documentation, nor can we replicate the error on a machine of a similar build. The gcloud CLI has worked without any error on my Python 3 machine for months.
After today's update, any gcloud command is met with the below error message, looking for a Python 2.7 interpreter. I'm at a loss as to how to proceed - even when attempting to uninstall with the gcloud command the same error is thrown.
This is a known issue that is being tracked here
Version 2.74 installation is broken on Windows. You will need to install an older version. This can be fixed by hand-editing gcloud.cmd but I do not recommend this.
Use the following link to download a previous version after uninstalling the current version.
Installing from versioned archives
[UPDATE 12/30/2019]
Google has released a minor revision update that appears to fix this problem. The revised update is version 2.74.0.1.

How to run jenkins with old version of Java instead the latest default one on MacOS?

I'm setting up Jenkins on my Macbook (High Sierra), seems like the default version of Java is Java 9, which causes issue "java.lang.AssertionError: InstanceIdentity is missing its singleton"
I changed the Java home of my Mac from 9.x to 8 already, but when I reinstall, same trouble still comes along.
I checked the System Properties under Manage Jenkins/System Information, the value java.specification.version still is "9".
So how can I install Jenkins with old version of Java?
Or any workaround for it?
Here is what worked for me with OS X 10.13.2 (High Sierra).
I used "brew install jenkins" to install Jenkins. You can find instructions from http://flummox-engineering.blogspot.com/2016/01/installing-jenkins-os-x-homebrew.html, for example.
Download JDK 8 from http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Set your JAVA_HOME and JDK_HOME to point to the version you downloaded. (Put this is your .bash_profile if needed.)
For example,
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home
export JDK_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home
Type in "jenkins --httpPort=9898" or whatever port is desired to start Jenkins.
If you aren't using the brew installation, you can open the start script at
/Library/Application Support/Jenkins/jenkins-runner.sh
and set your JAVA_HOME at the top of the script using the following line
export JAVA_HOME="`/usr/libexec/java_home -v 1.8`"
Then restart Jenkins and you'll be running Jenkins on 1.8

Finding Groovy on Mac OS after installing it via SDKMAN

I am using Mac OS and have installed groovy via SDKMAN. It says that groovy is installed however I do not know where it has been installed or how to open it and if I need to install an environment to open it in. Any help would be hugely appreciated.
When you install groovy (or other tool) via sdkman, it defines an environment variable: _TOOL_HOME in this particular case it will be GROOVY_HOME.
Run:
echo $GROOVY_HOME
in terminal and you will know the place where it's installed.

Which version of apache ant is compatible with OS X 10.7.5?

I've had so much trouble in installing ant. I first downloaded it from the apache website, had some errors. Then I finally figured out a way to install through terminals 'brew install ant'; which it worked after downloading Xcode and configuring bash_profile.
So my question is, why does it show that the version is 1.8.2? instead of 1.9.7? Is this a compatibility issue?
This is my output
To my knowledge, All OS X versions prior to 10.9 have ANT already installed. From 10.9 and later , we need to install ANT.
Installation ANT is about extracting tar file, setting ANT_HOME variable, Setting path and setting JAVA_HOME as well.
In my view, you are already seeing an older version of ANT installed in your machine by default. However, ANT 1.8.x or 1.9.x both are pretty stable and should able to meet your build automation objectives.

Uninstall postgresql on MacOs Lion Mountain

I'm completely new with MacOS X and I'm not underestanding where my system postgresql 9.1.5 is installed. I want to upgrade to 9.2 but I would like to uninstall this default installation before.
When I type in the terminal
$> psql --version
The result is:
psql (PostgreSQL) 9.1.5
but I can not find this installation.
MacOS X does not come with PostgreSQL installed as a server (unless you have OS X Server Edition).
Only the client-side PostgreSQL commands and the libpq library ship with the system. These include the psql command that resides is /usr/bin along with other commands such as pg_dump, pg_restore, createdb... You don't have to remove them, and if you did, it's not clear anyway what would prevent the next maintenance update of the OS to put them back.
So if you didn't previously install PostgreSQL yourself on this system, going to 9.2 is not an upgrade, it's a fresh install.
There are a number of providers of PostgreSQL packages for Mac OS X: postgres.app, homebrew, fink, macports...
These packages provide both a server and the client tools with the same version than the server, they have distinct installation paths, and they don't overwrite anything in /usr/bin. Once installed, you want to use the commands from the package preferrably to the ones in /usr/bin, which means technically putting them first in your PATH. Each package I've seen comes with a mention on how to do that in its installation instructions.
You don't have to remove the version Apple ships.
I have been using MacPorts to run various custom builds of PostgreSQL on OSX. It takes a little effort to make it "just work" (PATH and PG environment variables) but I never had to remove Apple's copy of Postgres.
I also keep a VM (VirtualBox) of a pretty minimal Debian install with Postgres running. I can do all my testing against the VM with a change of PG variables or JDBC URL. It's not as performant as running on the host but it is really clean for development.

Resources