Uploaded March 2023 | Updated November 2026, 2 hours ago
Okay I messed up, big time. The signing certificate for our gem expired over a year ago. When you add a cert to your gem, you're making a contract with your consumers that you will have a current signed version of your gem available at all times.
With an expired cert, a HighSecurity or even MediumSecurity install will fail. We need to rectify this. The process we use to update the gem certificate
* Move the old cert to an archive directory
* Un-trust the old cert with `gem cert --remove [path_to_cert]`
* Generate the new cert from the ~/.ssh directory of the local machine using the command:
`gem cert --build [email in gemspec]`
* Change permission for the private key to 0600
* Copy the PUBLIC certificate to the new directory with the command
`cp ~/.ssh/gem-public_cert.pem certs/[RubyGems user name].pem from the gem's root directory
* Trust the new cert with `gem cert --add certs/[RubyGems user name].pem` from the root directory of the gem
* Test a build version of the gem with `gem build nerd_dice.gemspec`
* Install the built version of the gem with the command
`gem install ./nerd_dice-0.5.0.gem -P HighSecurity` (replace with built version in the future)
* Uninstall the test version of the gem with the command
`gem uninstall nerd_dice -v 0.5.0` (replace as appropriate)
In this video, the need to explicitly remove the expired cert before adding the new one gives us some trouble, but we figure it out and now our users will be able to install with high security again once we release.
This video covers:
00:00:12 Introduction
00:01:14 Demonstrate the problem
00:03:08 Archive the expired certificate and key
00:04:48 Generate the new cert and private key
00:06:41 Copy the new cert to the certs directory of the gem
00:08:38 Build the gem and test that it can be installed with HighSecurity, fails
00:10:49 Troubleshoot install failure. Solution is to remove the old cert before adding the new one
00:15:06 Test install with high security successful; uninstall test version
00:15:49 Commit the new certificate
00:16:34 Update the SECURITY.md file with new end-of-life date for other versions and amend commit to include change
00:18:54 Push to the remote, open pull request, ensure process for updating the certificate is noted in a comment in the issue
00:21:01 Merge pull request and update backlog
#ruby #rubygems #codecast #screencast #NerdDice #DnD #roleplaying #softwaredevelopment #github #opensource #dice #tlm #certificatemanagement #expiredcert
See other related StatelessCode videos:
- Create a RubyGem 06: Release the Gem! youtu.be/4ihGTcy9jtI
Resources that we relied upon for this solution:
- Publishing your gem RubyGems.org guides.rubygems.org/publishing
- Security guide RubyGems.org guides.rubygems.org/security
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.
Okay I messed up, big time. The signing certificate for our gem expired over a year ago. When you add a cert to your gem, you're making a contract with your consumers that you will have a current signed version of your gem available at all times.
With an expired cert, a HighSecurity or even MediumSecurity install will fail. We need to rectify this. The process we use to update the gem certificate
* Move the old cert to an archive directory
* Un-trust the old cert with `gem cert --remove [path_to_cert]`
* Generate the new cert from the ~/.ssh directory of the local machine using the command:
`gem cert --build [email in gemspec]`
* Change permission for the private key to 0600
* Copy the PUBLIC certificate to the new directory with the command
`cp ~/.ssh/gem-public_cert.pem certs/[RubyGems user name].pem from the gem's root directory
* Trust the new cert with `gem cert --add certs/[RubyGems user name].pem` from the root directory of the gem
* Test a build version of the gem with `gem build nerd_dice.gemspec`
* Install the built version of the gem with the command
`gem install ./nerd_dice-0.5.0.gem -P HighSecurity` (replace with built version in the future)
* Uninstall the test version of the gem with the command
`gem uninstall nerd_dice -v 0.5.0` (replace as appropriate)
In this video, the need to explicitly remove the expired cert before adding the new one gives us some trouble, but we figure it out and now our users will be able to install with high security again once we release.
This video covers:
00:00:12 Introduction
00:01:14 Demonstrate the problem
00:03:08 Archive the expired certificate and key
00:04:48 Generate the new cert and private key
00:06:41 Copy the new cert to the certs directory of the gem
00:08:38 Build the gem and test that it can be installed with HighSecurity, fails
00:10:49 Troubleshoot install failure. Solution is to remove the old cert before adding the new one
00:15:06 Test install with high security successful; uninstall test version
00:15:49 Commit the new certificate
00:16:34 Update the SECURITY.md file with new end-of-life date for other versions and amend commit to include change
00:18:54 Push to the remote, open pull request, ensure process for updating the certificate is noted in a comment in the issue
00:21:01 Merge pull request and update backlog
#ruby #rubygems #codecast #screencast #NerdDice #DnD #roleplaying #softwaredevelopment #github #opensource #dice #tlm #certificatemanagement #expiredcert
See other related StatelessCode videos:
- Create a RubyGem 06: Release the Gem! youtu.be/4ihGTcy9jtI
Resources that we relied upon for this solution:
- Publishing your gem RubyGems.org guides.rubygems.org/publishing
- Security guide RubyGems.org guides.rubygems.org/security
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.










![Install Ruby and Rails with Databases on Ubuntu 24.04
In this video we take a fresh installation of Ubuntu 24.04 (see the link to the video where we installed it below) and set it up so we can develop applications using Ruby on Rails.
Before we can install Ruby, we first need to install some dependencies onto our system. There have been some slight changes to the set of dependencies since the last Ruby install video we made in 2021 using Ubuntu 20.04. In particular, libgconf-2-4 is no longer needed (and the install will error out if you try to include it in the list of packages).
We use Ruby Version Manager (RVM) to install Ruby. Pay attention to the post install configuration steps and do a full system reboot. In the aforementioned 2021 video, it didnt go smoothly.
We install the current versions of Ruby (3.3.3) and Ruby on Rails (7.1.3.4) at the time of the recording. There are 3 primary database adapters for Rails. SQLite3 comes built-in as the default and is what you get if you run `rails new` without specifying a database. Rails also comes with a MySQL adapter and a PostgreSQL adapter. We create initial applications for each. If you have a particular database in mind, you can skip to that section of the video.
Here are (most of) the commands we execute in the video:
```
# install dependencies
sudo apt install -y autoconf bison build-essential curl g++ gcc git git-core libffi-dev libgdbm-dev libncurses-dev libreadline-dev libsqlite3-dev libssl-dev libxi6 libyaml-dev make sqlite3 xvfb zip zlib1g-dev libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common gnupg2
# optional dependencies if using ActionText and/or ActiveStorage
sudo apt install -y libvips-tools libvips-dev libvips42
# rvm commands
gpg2 keyserver keyserver.ubuntu.com recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
sudo apt-add-repository -y ppa:rael-gc/rvm
sudo apt install rvm
sudo usermod -a -G rvm $USER
source /etc/profile.d/rvm.sh
mkdir -p ~/.rvm/user/installs
# ruby commands
rvm install 3.3.3
/bin/bash login
rvm use 3.3.3 default
ruby -v
irb
# rails commands
gem install rails
rails new [app name] [-d database or omit to use sqlite3]
# installs MariaDB 10.11
sudo apt install mariadb-server libmariadb-dev
# install PostgreSQL 16
sudo apt install postgresql libpq-dev
```
This video covers:
00:00:00 Introduction
00:02:38 Install dependencies for Ruby and Rails (see command above)
00:05:06 Install optional dependencies for ActionText and ActiveStorage
00:05:35 Install Ruby Version Manager (RVM) via Personal Package Archive (PPA)
00:07:45 RVM post-install configuration and reboot machine
00:10:34 Install current version of Ruby (3.3.3 at time of recording)
00:12:59 Install Ruby on Rails version 7.1.x
00:15:09 Create a Rails app and start the server (using SQLite3)
00:18:17 Optional: Install MariaDB and create a Rails app with the MySQL adapter and configure
00:26:20 Optional: Install PostgreSQL and create a Rails app with the PostgreSQL adapter
#setup #configuration #install #linux #ubuntu #debian #deb #terminal #ubuntu24 #lts #ruby #rails #rubyonrails #rvm #rails7 #rails7-1 #sqlite3 #mariadb #mysql #postges #postgresql
See 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
- Why Rails in the 2020s? https://youtu.be/f1ca3rKQSD0
Older Ruby and Rails install videos from 2021:
- Codecast: Install Rails 6, PostgreSQL 13, MariaDB 10.5 https://youtu.be/mW3vAvUg2Ao
- Install RVM and Ruby with Troubleshooting https://youtu.be/h-JBRJH8W7A
Featured Playlist:
- Getting Started with Rails 7 Playlist https://youtube.com/playlist?list=PL9kkbu1kLUePk2NNqMT14iL3Dis2mbMdK
Resources that we relied upon for this solution:
- Ruby Website: https://www.ruby-lang.org/en/
- Ruby on Rails Website: https://rubyonrails.org/
- RVM Website: https://rvm.io/
- GoRails Install Ruby On Rails on Ubuntu 24.04 Noble Numbat https://gorails.com/setup/ubuntu/24.04
This video is CC0 - No rights reserved. (YouTube doesnt allow this option when publishing.) All code is released under the UNLICENSE. Stateless Code denies the concept of intellectual property. Copying is not stealing. Install Ruby and Rails with Databases on Ubuntu 24.04](https://i.ytimg.com/vi/XB6lPKAzRxc/mqdefault.jpg)