I had a similar issue today. Here’s what worked for me. I tried using Michael’s approach but received a similar error.
So instead, I removed the gem that I thought was giving me an error, by
gem uninstall sqlite3 -v 1.4.0
and instead, used in my gem file.
gem 'sqlite3', '~> 1.3.6'
Ran the bundle update and it worked like a charm for me.