replace_gem:加载“sqlite3"活动记录适配器时出错 - 创建模型时 [英] replace_gem: Error loading the 'sqlite3' Active Record adapter - while creating model

查看:32
本文介绍了replace_gem:加载“sqlite3"活动记录适配器时出错 - 创建模型时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在创建的项目中创建模型时出错,错误如下,

<块引用>

/home/sushmitha/.rvm/gems/ruby-2.5.1/gems/bundler-2.0.1/lib/bundler/rubygems_integration.rb:408:在replace_gem中的块(2级)":加载错误sqlite3"活动记录适配器.缺少它所依赖的宝石?无法激活 sqlite3 (~> 1.3.6),已经激活了 sqlite3-1.4.0.确保所有依赖项都添加到 Gemfile.(加载错误)

解决方案

以下添加仅供参考,

对于 Rails 5+,这个问题是通过在你的 Gemfile 中为 sqlite gem 指定适当的版本来解决的,同时使用SQLite 数据库:

 gem 'sqlite3', '~>1.3', '> = 1.3.6'

参考

I am getting an error while creating a model in the created project and the error is as follows,

/home/sushmitha/.rvm/gems/ruby-2.5.1/gems/bundler-2.0.1/lib/bundler/rubygems_integration.rb:408:in `block (2 levels) in replace_gem': 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. (LoadError)

For reference only following is added here,

For Rails 5+, this issue is sort out by specifying the appropriate version for the sqlite gem in your Gemfile while working with an SQLite database:

 gem 'sqlite3', '~> 1.3', '>= 1.3.6'

Reference

这篇关于replace_gem:加载“sqlite3"活动记录适配器时出错 - 创建模型时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆