SQLite (3.7.17) 版本太旧.Active Record 支持 SQLite >= 3.8 [英] Version of SQLite (3.7.17) is too old. Active Record supports SQLite >= 3.8
问题描述
我正在尝试在我的 EC2 实例中运行 Rails 6,但遇到以下错误:
I am trying to run Rails 6 in my EC2 instance, but I am encountering the following error:
您的 SQLite (3.7.17) 版本太旧.Active Record 支持 SQLite >= 3.8.
如果重要:
- 我的 gem 文件中有以下内容:gem 'sqlite3', '~>1.4
- 我正在使用以下命令:rvmsudo rails server -p 80 -b 0.0.0.0
- 当我在本地运行 rails s
时,我没有遇到这个问题.
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.
这与 此处,但所选答案特定于使用 AWS Cloud9.
This is the same issue as here, but the selected answer was specific to using AWS Cloud9.
以下是运行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
分别是运行sudo yum install libsqlite3-dev
和sudo yum install sqlite3
后的结果:
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
编辑 2:
当运行 rails db:migrate
我看到这个:
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
推荐答案
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
这篇关于SQLite (3.7.17) 版本太旧.Active Record 支持 SQLite >= 3.8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!