I have upgraded a rails application to Rails 5.1 and see a strange issue.
When I check the mysql2_adapter.rb
for the active_record gem I that the top 3 Line are
require "active_record/connection_adapters/abstract_mysql_adapter"
require "active_record/connection_adapters/mysql/database_statements"
gem "mysql2", ">= 0.3.18", "< 0.5"
however when I check the active_record gem on GitHub for the version 5.1 I see that the lines are different
require "active_record/connection_adapters/abstract_mysql_adapter"
require "active_record/connection_adapters/mysql/database_statements"
gem "mysql2", ">= 0.3.18", "< 0.6.0"
Can anyone please help as to why the active_record 5.1 on my local machine has different code compared to what's on GitHub.
may be I missed something during rails upgrade.
The version you see on Github was the outcome of this pull request being merged on 2018-03-18. After that date, only Ruby on Rails 5.1.6 and 5.1.7 were released.
But when I look at the stack trace of your question from yesterday, it feels like you are running Ruby on Rails 5.1.0
.
That means your Ruby on Rails version is about one year older than the latest Ruby on Rails 5.1.x version on GitHub.
I suggest updating your Rails version at least to 5.1.7
by adding
gem 'rails', '~> 5.1.7'
to your Gemfile
and then running bundle install
again.