'Version of SQLite (3.7.17) is too old. Active Record supports SQLite >= 3.8

I am trying to run Rails 6 in my EC2 instance, but I am encountering the following error:

Your version of SQLite (3.7.17) is too old. Active Record supports SQLite >= 3.8.

If it matters:
- I have the following in my gem file: gem 'sqlite3', '~> 1.4
- I am using the following command: rvmsudo rails server -p 80 -b 0.0.0.0
- When I run rails s locally I do not encounter the issue.

This is the same issue as here, but the selected answer was specific to using AWS Cloud9.

EDIT:

Here are the results after running sudo yum install build-essential libsqlite3-dev sqlite3 software-properties-common:

Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
No package build-essential available.
No package libsqlite3-dev available.
No package sqlite3 available.
No package software-properties-common available.
Error: Nothing to do

Here are the results after after running sudo yum install libsqlite3-dev and sudo yum install sqlite3, respectively:

Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
No package libsqlite3-dev available.
Error: Nothing to do
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
No package sqlite3 available.
Error: Nothing to do

EDIT 2:
When running rails db:migrate I see this:

warning Skipping preferred cache folder "/home/ec2-user/.cache/yarn" because it is not writable.
warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-1000".
** Execute db:load_config
** Execute db:migrate
rails aborted!
Your version of SQLite (3.7.17) is too old. Active Record supports SQLite >= 3.8


Solution 1:[1]

Instruction for updeting for Centos7:

wget https://www.sqlite.org/2019/sqlite-autoconf-3290000.tar.gz

tar xzvf sqlite-autoconf-3290000.tar.gz

cd sqlite-autoconf-3290000

./configure --prefix=/opt/sqlite/sqlite3

make

sudo make install

/opt/sqlite/sqlite3/bin/sqlite3 --version

gem uninstall sqlite3

gem install sqlite3 -- --with-sqlite3-include=/opt/sqlite/sqlite3/include \ --with-sqlite3-lib=/opt/sqlite/sqlite3/lib

Solution 2:[2]

This worked perfectly for me:

$ wget https://kojipkgs.fedoraproject.org//packages/sqlite/3.8.11/1.fc21/x86_64/sqlite-devel-3.8.11-1.fc21.x86_64.rpm

$ wget https://kojipkgs.fedoraproject.org//packages/sqlite/3.8.11/1.fc21/x86_64/sqlite-3.8.11-1.fc21.x86_64.rpm

$ sudo yum install sqlite-3.8.11-1.fc21.x86_64.rpm sqlite-devel-3.8.11-1.fc21.x86_64.rpm

Solution 3:[3]

If after MartenCatcher answer you still get the same error, most likely you will need to (for CentOs 7)

# Replace system low version sqlite3
mv /usr/bin/sqlite3 /usr/bin/sqlite3_old
ln -s /opt/sqlite/sqlite3/bin/sqlite3 /usr/bin/sqlite3
echo "/opt/sqlite/sqlite3/lib" > /etc/ld.so.conf.d/sqlite3.conf
ldconfig
sqlite3 -version

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 MartenCatcher
Solution 2 jmoerdyk
Solution 3 ????? ??????