Specified sqlite3 gem not loaded

≯℡__Kan透↙ 提交于 2019-12-07 14:44:05

问题


Although I am relatively new to Ruby on Rails, I have been developing apps for a short while now. The problem I seem to have is when I create a new rails app (locally / using c9) I seem to be getting this error when I start up the apache server

"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)"

In My Gem file I can see that the sqlite3 gem is present.

I have tried uninstalling and reinstalling the sqlite3 gem trying both versions 1.3.13 as well as 1.4.0 but with no success.

I have also 'git cloned' one of my older completed apps from git hub on to my 'local' and c9 development environments and will work perfectly until I bundle update, Then I get the same error message!

Can anyone give me some advise? I am aware that this problem was brought up a few years back but was wondering if anyone has encountered this recently and if/how they resolved this?

Many Thanks


回答1:


It is very strange but two weeks ago I also got the same issue, and when I initiate my rails new project it put gem 'sqlite3' without any version number, and I get the same error. So I played a lot on brew so I thought it is an issue due to that playing with SQLite, somehow I came to know that maybe my Sqlite3 gem has an issue. And I noticed it is loading 1.4 version of it.

I did following change and it worked.

gem 'sqlite3', '~> 1.3.11'

Just in case if someone searching answer of this question, as it resolved issue of question asker.



来源:https://stackoverflow.com/questions/54653687/specified-sqlite3-gem-not-loaded

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!