Uploaded January 2022 | Updated November 2026, 3 hours ago
This is the 19th video in the Getting Started with Rails 7 series. In this video Mike starts the section on basic authentication and gets it working. Then he tries and does not (yet) succeed in getting the browser tests working with basic auth.
This video covers:
00:00:10 Introduction and review
00:05:07 Adapt ArticlesControllerTest for authenticated and unauthenticated user scenarios
00:13:20 Implement basic auth in ArticlesController
00:15:15 Validate behavior in UI
00:16:17 Fix failures in ArticlesControllerTest due to incorrect hash structure on update action
00:18:29 Adapt CommentsdControllerTest for authenticated and unauthenticated user scenarios and add auth to CommentsController
00:20:38 Try to get browser tests to work with Basic Authentication
00:45:36 To be continued...
Notes:
* As pointed out by Rails From Zero (youtube.com/channel/UCBIvferzfG3glF2iOz-oN9w) in the comments below, adding the debugger command to the in the test would have allowed us to pause the code and examine the current state (both in IRB and in the JavaScript console). This would have made debugging more efficient.
* Trying to get the browser tests to work with Basic Auth was not a smooth process. We leave the mistakes and troubleshooting in the videos on purpose because you can still learn from when things don't go well. See Why Leave Mistakes in the Videos youtu.be/-9bgFkLaWXY for more.
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.
This is the 19th video in the Getting Started with Rails 7 series. In this video Mike starts the section on basic authentication and gets it working. Then he tries and does not (yet) succeed in getting the browser tests working with basic auth.
This video covers:
00:00:10 Introduction and review
00:05:07 Adapt ArticlesControllerTest for authenticated and unauthenticated user scenarios
00:13:20 Implement basic auth in ArticlesController
00:15:15 Validate behavior in UI
00:16:17 Fix failures in ArticlesControllerTest due to incorrect hash structure on update action
00:18:29 Adapt CommentsdControllerTest for authenticated and unauthenticated user scenarios and add auth to CommentsController
00:20:38 Try to get browser tests to work with Basic Authentication
00:45:36 To be continued...
Notes:
* As pointed out by Rails From Zero (youtube.com/channel/UCBIvferzfG3glF2iOz-oN9w) in the comments below, adding the debugger command to the in the test would have allowed us to pause the code and examine the current state (both in IRB and in the JavaScript console). This would have made debugging more efficient.
* Trying to get the browser tests to work with Basic Auth was not a smooth process. We leave the mistakes and troubleshooting in the videos on purpose because you can still learn from when things don't go well. See Why Leave Mistakes in the Videos youtu.be/-9bgFkLaWXY for more.
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)







