SQLite的版本(3.7.17)太旧,活动记录支持SQLite>=3.8

ybzsozfc  于 2022-11-15  发布在  SQLite
关注(0)|答案(4)|浏览(172)

我正尝试在EC2示例中运行rails 6,但遇到以下错误:
Your version of SQLite (3.7.17) is too old. Active Record supports SQLite >= 3.8.
如果这很重要:
-我的gem文件中有以下内容:gem 'sqlite3', '~> 1.4
-我使用以下命令:rvmsudo rails server -p 80 -b 0.0.0.0
-当我在本地运行rails s时,没有遇到该问题。
这是与here相同的问题,但选择的答案特定于使用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-devsudo yum install sqlite3后的结果:

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
ia2d9nvy

ia2d9nvy1#

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
vtwuwzda

vtwuwzda2#

这对我来说非常有效:

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
ppcbkaq5

ppcbkaq53#

如果在MartenCatcher回答之后,您仍然收到相同的错误,您很可能需要(针对CentOS7)

# 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
tsm1rwdh

tsm1rwdh4#

如果您对EC2示例具有管理员访问权限,请运行以下命令

sudo apt-get install libsqlite3-dev
sudo apt-get install sqlite3

相关问题