Active Record 5.1指向早期版本?

huangapple go评论52阅读模式
英文:

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

GitHub Link


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 &quot;active_record/connection_adapters/abstract_mysql_adapter&quot;
require &quot;active_record/connection_adapters/mysql/database_statements&quot;

gem &quot;mysql2&quot;, &quot;&gt;= 0.3.18&quot;, &quot;&lt; 0.5&quot;

however when I check the active_record gem on GitHub for the version 5.1 I see that the lines are different

https://github.com/rails/rails/blob/5-1-stable/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb


require &quot;active_record/connection_adapters/abstract_mysql_adapter&quot;
require &quot;active_record/connection_adapters/mysql/database_statements&quot;

gem &quot;mysql2&quot;, &quot;&gt;= 0.3.18&quot;, &quot;&lt; 0.6.0&quot;

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 &#39;rails&#39;, &#39;~&gt; 5.1.7&#39; 

to your Gemfile and then running bundle install again.

huangapple
  • 本文由 发表于 2023年5月7日 22:16:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/76194469.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定