运行rails server
时,我会加载以下警告:
Gem::LoadError: Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 'sqlite3'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).
但是我的gemfile中有gem
group :development do
gem 'sqlite3'
是什么导致此错误?
更新答案 0 :(得分:1)
删除了gem sqlite3(v 1.4.0)并安装了1.3.13版,并且可以正常工作
答案 1 :(得分:1)
gem cleanup sqlite3
和
bundle install
让Rails选择sqlite3
的正确版本
答案 2 :(得分:0)
在AWS cloud9环境中存在相同的问题。您需要更改gemfile来读取gem'sqlite3','〜> 1.3.6',然后运行bundle update。是从“ can't activate sqlite3 (~> 1.3.6), already activated sqlite3-1.4.0”那里获得的