英文:
active_record 5.1 pointing to earlier version?
问题
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.
英文:
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.
答案1
得分: 3
GitHub上看到的版本是由于2018年3月18日合并的这个pull request的结果。在那之后,只发布了Ruby on Rails 5.1.6和5.1.7。
但是,当我看到你昨天提出问题的stackoverflow堆栈跟踪时,感觉你在运行Ruby on Rails 5.1.0
。
这意味着你的Ruby on Rails版本比GitHub上最新的Ruby on Rails 5.1.x版本要旧大约一年。
我建议你至少将Rails版本更新到5.1.7
,方法是在你的Gemfile
中添加:
gem 'rails', '~> 5.1.7'
然后再次运行bundle install
。
英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论