How to use a specific older version of Ruby on Azure DevOps Pipeline? - ruby

I have a project that needs to use Ruby with the exact version of 2.7.5.
I tired using Azure's UseRubyVersion#0 to install it:
- task: UseRubyVersion#0
inputs:
versionSpec: "2.7.5"
But this resulted in an error:
##[warning]Specifying an exact version is not recommended on Microsoft-Hosted agents. Patch versions of Ruby can be replaced by new ones on Hosted agents without notice, which will cause builds to fail unexpectedly. It is recommended to specify only major or major and minor version (Example: `2` or `2.4`)
##[error]Version spec 2.7.5 for architecture %s did not match any version in Agent.ToolsDirectory.
Available versions: /Users/runner/hostedtoolcache
2.7.7,3.0.5,3.1.3
As you can see, Azure only provides the latest patch of minor versions, so installing a specific version like 2.7.5 is not possible.
Is there an alternative way to install a specific version of Ruby in an Azure DevOps Pipeline?

You must at least bump to the latest patch version of 2.7 that is 2.7.7. 2.7.6 and 2.7.7 are bringing important security fixes, that's exactly why Azure does not allow old patch versions. You should take this seriously, this could cost your company to shutdown his activity.
More details:
https://www.ruby-lang.org/en/news/2022/04/12/ruby-2-7-6-released/
https://www.ruby-lang.org/en/news/2022/11/24/ruby-2-7-7-released/

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.

Legacy mode Cocoapods

Is there a legacy mode for Cocoapods that allows a user to use a version of Cocoapods as if it was an older one? Eg use 1.0.0 as if it was 0.39 via a command line argument to avoid downloading legacy versions.
You will need the version to be installed. However, there is nothing wrong with having multiple versions installed. You can also delete them if you no longer need a specific version.
Once installed, run the version you want with this:
pod _0.39.0_ YourCommandHere
Change the version number as needed.

Composer tilde syntax (Next significant release)

I've installed amnah/yii2-user library from packagist via composer into my project. The project's composer.json relevant require section looks like:
"amnah/yii2-user": "~2.0"
To my understanding, this should install the latest version with a major version of "2". When I check the installed package via composer show amnah/yii2-user -v, I see the following version information:
versions : dev-master, 2.1.0-alpha4, 2.1.0-alpha3, 2.1.0-alpha2, 2.1.0alpha,
* 2.0.0-alpha2, 2.0.0-alpha, 1.0.0-beta
So 2.0.0-alpha2 is installed, the 2.1 versions are ignored. Isn't it supposed to work like
Another way of looking at it is that using ~ specifies a minimum
version, but allows the last digit specified to go up.
as the documentation states? I'd need the latest 2.x version installed. What am I missing?
If you need the latest 2.x version installed, you should use ~2.1 if "latest" means that at that time a version 2.1 is the most current version released.
But I wonder why you are getting the alpha version installed. Usually Composer defaults to only install stable versions, no release candidates (rc), beta, alpha nor dev versions. Did you add a setting for minimum-stability and/or preferred-stability?
So if you want alpha versions, you should require ~2.1#alpha.
And a word of caution: The project you are using does require yiisoft/yii2: * and yiisoft/yii2-authclient: * - asterisk meaning that ANY version is sufficient. Yii itself claims that the released 1.1 version is incompatible with the newer 2.0 series (which is not yet released), whatever that means.

Gradle dependencies: is the newest or oldest version used?

I'm using Android Studio 0.8.9 and I have a following line in my build.gradle:
compile group: 'com.nostra13.universalimageloader', name: 'universal-image-loader', version: '1.9.+'
What will be the actual version of the library used in this case? 1.9.0 or 1.9.3 (latest)?
I'm asking because I recently got a bug report in BugSense with a crash in UniversalImageLoader but the stacktrace is not relevant to the latest version (1.9.3)
The + means that it will use the latest version of the 1.9.X series, which according to Maven Central as of now: http://search.maven.org/#search%7Cga%7C1%7Ccom.nostra13.universalimageloader is 1.9.3.
With the version set up like this, if 1.10.0 were to be released, you wouldn't pick it up -- that + symbol is only a wildcard for the third part of the version number triplet. If you wanted to get the latest version regardless, you could use:
compile 'com.nostra13.universalimageloader:universalimageloader:+'
Note that we don't really recommend that you use the + syntax in version numbers for dependencies. For one, it will make a network request to see if there's a new version, which is a problem for a lot of developers trying to work offline. I believe it only checks once a day, but it can still be a problem. More importantly, it can cause your build to fail in unpredictable ways -- if a new version is released and it causes a compile error or bug, it can be mysterious why your build worked yesterday but started failing today.

XCode. How Do I Run Two Versions on the Same Dev. Machine: Version 3.2.2 (Pre-release) & Version 3.2.1

Could someone walk me through the setup to run one version of XCode for iPad development - version 3.2.2 prerelease - and another version for iPhone/iPodTouch development - version 3.2.1
The reason I ask is because the pre-release version does not support building < 3.2 iPhone OS. Or if it does I haven't figured out the magic handshake to make that happen. If you know please pass it along. Cheers.
Thanks,
Doug
You can actually change the install location when installing the beta versions... make it something like /DeveloperBeta instead of /Developer, then you can choose which version of the dev tools to run.

Resources