'bundle install: Bundler could not find compatible versions for gem "activemodel"

I'm trying to run bundle install and getting the following error:

Bundler could not find compatible versions for gem "activemodel": In Gemfile: rails (= 5.1.5) was resolved to 5.1.5, which depends on activemodel (= 5.1.5)

web-console (~> 2.0) was resolved to 2.0.0, which depends on activemodel (~> 4.0)

I have tried updating ruby and the rails version



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source