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
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With