railsgirls-jp / coach.info

3 stars 1 forks source link

Error loading the 'sqlite3' Active Record adapter. #26

Open igaiga opened 5 years ago

igaiga commented 5 years ago

現象

/Users/igaiga/.rbenv/versions/2.6.1/lib/ruby/2.6.0/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)

上記のエラーがrails s後にアクセスする際に発生する

発生する環境

解決方法

Gemfileで以下の変更を入れる。

gem 'sqlite3'

gem "sqlite3", "< 1.4"

参考にしたコード(Railsの5-2-stableブランチで今後入るコードに揃えた)

https://github.com/rails/rails/commit/6d5f2511e6d9b95a8ac8399c234aa6cd074af51d

naoty commented 5 years ago

手元で試してみたんですが、rails newしたときにsqlite31.4.0がインストールされるので、

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

と書き換えてbundle updateしても、1.4.0"~> 1.3", ">= 1.3.6"を満たしているので、1.3.xにdowngradeされないんじゃないかな〜と思いました。

エラーメッセージにあるように

gem "sqlite3", "~> 1.3.6"

でどうでしょう?

igaiga commented 5 years ago

(゚◇゚)ガーン では、naotyさん案で! descriptionも書き換えておきました。

igaiga commented 5 years ago

松田さんより < 1.4 が分かりやすかろうという案がでて、その通りだと思うのでdescription置き換えました。 @naoty さん動作確認感謝です。m( )m

pmpinto commented 1 year ago

@igaiga I'm very glad this repo is public 🙏

I don't speak (nor read) Japanese but I was struggling with this error since yesterday. Today I found this issue and decided to translate it, and it was totally worth it!

Very much appreciated! 🙇