无法激活 sqlite3 (~> 1.3.6),已激活 sqlite3-1.4.0 [英] can't activate sqlite3 (~> 1.3.6), already activated sqlite3-1.4.0
本文介绍了无法激活 sqlite3 (~> 1.3.6),已激活 sqlite3-1.4.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用的是 Ubuntu,在为 ruby 项目使用 db:migrate 时遇到了问题.
I’m using Ubuntu and run into to a problem when using db:migrate for ruby project.
rails aborted!
LoadError: Error loading the 'sqlite3' Active Record adapter. Missing a gem it depends on? can't activate sqlite3 (~> 1.3.6), already activated sqlite3-1.4.0. Make sure all dependencies are added to Gemfile.
/home/juan/odin_on_rails/RailsaAPP/bin/rails:9:in `<top (required)>'
/home/juan/odin_on_rails/RailsaAPP/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Caused by:
Gem::LoadError: can't activate sqlite3 (~> 1.3.6), already activated sqlite3-1.4.0. Make sure all dependencies are added to Gemfile.
/home/juan/odin_on_rails/RailsaAPP/bin/rails:9:in `<top (required)>'
/home/juan/odin_on_rails/RailsaAPP/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Tasks: TOP => db:migrate => db:load_config
(See full trace by running task with --trace)
推荐答案
我今天遇到了类似的问题.这对我有用.我尝试使用 Michael 的方法,但收到了类似的错误.
I had a similar issue today. Here's what worked for me. I tried using Michael's approach but received a similar error.
因此,我删除了我认为给我错误的 gem,通过gem 卸载 sqlite3 -v 1.4.0
So instead, I removed the gem that I thought was giving me an error, by
gem uninstall sqlite3 -v 1.4.0
而是在我的 gem 文件中使用.gem 'sqlite3', '~>1.3.6'
运行 bundle update
,它对我来说就像一个魅力.
and instead, used in my gem file.
gem 'sqlite3', '~> 1.3.6'
Ran the bundle update
and it worked like a charm for me.
这篇关于无法激活 sqlite3 (~> 1.3.6),已激活 sqlite3-1.4.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文