Uploaded March 2023 | Updated November 2026, 2 hours ago
Sometimes the best way to solve a problem is to avoid it. Back in episode 89 when we ran into an issue where our build was failing on Ruby 2.7. Our fix at the time was to at least temporarily drop Ruby 2.7 from the GitHub actions build and add an item to the backlog to see if we could fix things.
In this video we tackle that backlog item. We start by taking a look at the Ruby Maintenance Branch Schedule to determine whether a fix is even worth the effort. As it turns out, Ruby 2.7 is in security maintenance only and is scheduled for End-of-Life on March 31, 2023. This video was filmed on February 22, 2023, so the Ruby version only has a little more than a month before it is unsupported.
Trying to figure out how to get the current version of RSpec to work with the 2.7 version of the gem could be time-consuming and not yield any value. We decide that the best solution, given the circumstances, is to drop support for 2.7 and bump the minimum version for future releases to 3.0. Sometimes dropping support for old versions of things is a necessary part of Technology Lifecycle Management.
Changing the minimum version requires us to upgrade the RuboCop target Ruby version, which surfaces some new violations. We had a hack in one of our shared examples that accounted for the difference in the Random class behavior between 2.7 and 3.0. With 2.7 no longer needing support, we can retire the hack and make our spec more concise.
We also no longer need to call .freeze on our regular expression literals because in Ruby 3.0 and up, they are frozen by default.
This video covers:
00:00:12 Introduction
00:01:28 Take a look at the Ruby Maintenance Branch Schedule
00:02:29 Decide to end support for Ruby 2.7 for new versions of the gem
00:03:40 Increase the required Ruby version to 3.0 in the gemspec, run `bundle install` and specs
00:04:54 Run RuboCop and fix the new violation by updating the target Ruby version
00:05:51 Remove the Ruby 2.7 specific code condition from an RSpec shared example
00:07:54 Autocorrect redundant freeze violations now that Ruby 2.7 is no longer supported
00:08:45 Review the changes in the git diff
00:09:15 Refactor the shared example we fixed earlier to be more concise
00:10:51 Commit, push, pull request
00:12:01 Create a new milestone for the 0.5 release of the gem
00:13:39 Merge pull request, close issue
#ruby #rubygems #codecast #screencast #NerdDice #DnD #roleplaying #softwaredevelopment #github #opensource #dice #tlm #ruby27 #eol
See other related StatelessCode videos:
- Create a RubyGem 89: Add Ruby 3.2 to GitHub Actions and Update RSpec to a compatible version youtu.be/kid7Cc2dzRk
Resources that we relied upon for this solution:
- Ruby Maintenance Branch Schedule ruby-lang.org/en/downloads/branches
This video is CC0 - No rights reserved. (YouTube doesn't allow this option when publishing.) All code is released under the UNLICENSE. Stateless Code denies the concept of "intellectual property". Copying is not stealing.
Sometimes the best way to solve a problem is to avoid it. Back in episode 89 when we ran into an issue where our build was failing on Ruby 2.7. Our fix at the time was to at least temporarily drop Ruby 2.7 from the GitHub actions build and add an item to the backlog to see if we could fix things.
In this video we tackle that backlog item. We start by taking a look at the Ruby Maintenance Branch Schedule to determine whether a fix is even worth the effort. As it turns out, Ruby 2.7 is in security maintenance only and is scheduled for End-of-Life on March 31, 2023. This video was filmed on February 22, 2023, so the Ruby version only has a little more than a month before it is unsupported.
Trying to figure out how to get the current version of RSpec to work with the 2.7 version of the gem could be time-consuming and not yield any value. We decide that the best solution, given the circumstances, is to drop support for 2.7 and bump the minimum version for future releases to 3.0. Sometimes dropping support for old versions of things is a necessary part of Technology Lifecycle Management.
Changing the minimum version requires us to upgrade the RuboCop target Ruby version, which surfaces some new violations. We had a hack in one of our shared examples that accounted for the difference in the Random class behavior between 2.7 and 3.0. With 2.7 no longer needing support, we can retire the hack and make our spec more concise.
We also no longer need to call .freeze on our regular expression literals because in Ruby 3.0 and up, they are frozen by default.
This video covers:
00:00:12 Introduction
00:01:28 Take a look at the Ruby Maintenance Branch Schedule
00:02:29 Decide to end support for Ruby 2.7 for new versions of the gem
00:03:40 Increase the required Ruby version to 3.0 in the gemspec, run `bundle install` and specs
00:04:54 Run RuboCop and fix the new violation by updating the target Ruby version
00:05:51 Remove the Ruby 2.7 specific code condition from an RSpec shared example
00:07:54 Autocorrect redundant freeze violations now that Ruby 2.7 is no longer supported
00:08:45 Review the changes in the git diff
00:09:15 Refactor the shared example we fixed earlier to be more concise
00:10:51 Commit, push, pull request
00:12:01 Create a new milestone for the 0.5 release of the gem
00:13:39 Merge pull request, close issue
#ruby #rubygems #codecast #screencast #NerdDice #DnD #roleplaying #softwaredevelopment #github #opensource #dice #tlm #ruby27 #eol
See other related StatelessCode videos:
- Create a RubyGem 89: Add Ruby 3.2 to GitHub Actions and Update RSpec to a compatible version youtu.be/kid7Cc2dzRk
Resources that we relied upon for this solution:
- Ruby Maintenance Branch Schedule ruby-lang.org/en/downloads/branches
This video is CC0 - No rights reserved. (YouTube doesn't allow this option when publishing.) All code is released under the UNLICENSE. Stateless Code denies the concept of "intellectual property". Copying is not stealing.
![Set up a Salesforce Development Environment on Ubuntu 24.04
In this video, we guide you through setting up a Salesforce development environment on a new install of Ubuntu 24.04. The only things we have installed so far are Visual Studio Code, bzip2 and tar. We have other recent videos linked where we install Node.js (via NVM), VS Code, and Git, so we breeze through those steps quickly in this video.We start by installing Node. Then we install the Java 17 OpenJDK (and save the directory from the installation output so we can set it in the VS Code settings later.) After that we install Git.For the Salesforce CLI, I always use the install via NPM option, irrespective of which operating system I use. I find it to be easier to maintain and upgrade. After the CLI is installed, we install the Salesforce Extension Pack (including the expanded version). After the extension pack is installed we can set the Salesforcedx-vscode-apex Java: Home value in VS Code settings.We authorize our DevHub (a TrailHead developer edition) and create a scratch org and make it our default org with `sf config set`.When we try the `sf org open` command, it fails. Salesforce CLI assumes that the temporary directory being used is the system temporary directory. Ubuntu 24.04 has Firefox installed using snap. Snap sandboxing places the temp directory in the users home directory instead. There are two ways to resolve this. You can execute `TMPDIR=$HOME/temp sf org open [your-flags]` every time you run the sf org open command. This is tedious. The other option is that you can install a browser via apt instead of snap. Unfortunately Chromium will not work for this because the apt install uses snap. To resolve it, we install Chrome and make it the default browser. Theres a privacy trade-off here. Make the decision thats best for you.After we have the ability to open our scratch org, we create a Hello World! Taxation is theft! Lightning Web Component with a simple Jest test. We run npm install on the SFDX project directory so that we can run our JavaScript tests and everything.Finally we deploy the component to our scratch org, create a Lightning page with a few different instances of it, and retrieve everything back to our project.This video covers: 00:00:00 Introduction 00:01:38 Install Node 20 (requires curl and NVM) 00:03:19 Install Java 17 OpenJDK and copy the Java Home directory from the output 00:05:21 Install Git and Salesforce CLI NPM package 00:07:57 Install Salesforce Extension Pack (including Expanded) and configure Salesforce Java Home setting in VS Code 00:11:47 Use Salesforce CLI to login to DevHub 00:14:12 Create a scratch org 00:18:20 Workaround issue to get `sf org open` to work, option 1 adding TMPDIR variable to beginning of command 00:21:45 Alternative workaround, install Chrome via apt and set as default browser 00:29:13 Create a Hello World! Taxation is theft! Lightning Web Component and ensure Jest test framework works 00:36:35 Deploy the component to the scratch org, add to a Lightning Page, and retrieve the whole project back 00:40:37 Conclusion and preview of other upcoming Salesforce material #setup #configuration #install #linux #ubuntu #debian #deb #terminal #ubuntu24 #lts #github #code #visualstudiocode #vscode #apt #git #node #nodejs #nvm #npm #java #jdk #openjdk #salesforce #sfdx #salesforcecli #workaround #scratchorg #helloworldtaxationistheft #jest #lightningwebcomponent #lwcSee other related StatelessCode videos:- Install Ubuntu 24.04 LTS Desktop https://youtu.be/yHxuNUovS20- Install Node.js (versions 18, 20, 22) with NVM on Ubuntu 24.04 https://youtu.be/YyEf1QWfg9Y- Install Visual Studio Code on Ubuntu 24.04 https://youtu.be/GdmHY1JhLI8- Install Git on Ubuntu 24.04 and Configure for Verified Commits in GitHub https://youtu.be/CagiEjuqKxU- Migrate from SFDX CLI version 7.x to Salesforce CLI version 2.x https://youtu.be/kyii2tPwcBI- Codecast: Install Salesforce DX on Ubuntu 20.04 (from 2021) https://youtu.be/JaVf4FYcYw0Resources that we relied upon for this solution:- Lightning Web Components Developer Guide: Develop with Salesforce DX Tools https://developer.salesforce.com/docs/platform/lwc/guide/get-started-sfdx.html- Salesforce CLI Setup Guide https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm- Node.js package manager instructions (you can choose your OS and preferred method) https://nodejs.org/en/download/package-manager - Salesforce CLI Command Reference https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_unified.htm- sf org open GitHub issue on forcedotcom/cli repo https://github.com/forcedotcom/cli/issues/2769- Command line workaround by setting TMPDIR variable https://github.com/salesforcecli/plugin-org/pull/992#issuecomment-2013234183
This video is CC0 - No rights reserved. All code is released under the UNLICENSE. Set up a Salesforce Development Environment on Ubuntu 24.04](https://i.ytimg.com/vi/OC4R71bQO4g/mqdefault.jpg)









