0

我知道要更新 Rails,你更新你的版本号,Gemfile然后bundle update但我感到困惑的是你怎么知道是否有其他任何改变?

我怎么知道是否有要添加的配置选项或其他任何地方。文件或整个目录的内容。

有什么线索吗?

4

3 回答 3

2

Rails 升级分为以下几类;

  1. 补丁版本升级(例如,3.2.10 到 3.2.11)
  2. 次要版本升级(例如,3.1.X 到 3.2.X)
  3. 主要版本升级(例如,3.XX 到 4.XX)

主要/次要升级

主要和次要版本升级需要大量工作,我强烈建议您留意来自 Peepcode 或 Peter Cook 等人的截屏视频。

有时更容易做 arails new并将所有初始化程序和配置文件复制到应用程序的顶部,然后进行比较以查找更改的内容。

我总是建议一次做一个小版本。

例如,如果您仍在使用 2.3.x,则应先升级到 3.0.x,然后升级到 3.1.x,然后升级到 3.2.x

补丁升级

Patch version upgrades are generally simpler (and important since they often include security fixes). Look out for any deprecation notices in your logs, and fix the changes.

Do a Gemfile update, run your tests, and most of the time it'll be fine.

于 2013-01-08T23:57:13.887 回答
1

这当然取决于您要升级的版本。一般来说,Rails 可以很好地记录您需要在发行说明中更改的内容,例如:http ://edgeguides.rubyonrails.org/3_2_release_notes.html

有时,升级后的弃用通知会对您有所帮助。或者,您可以rails new使用全新的应用程序,并将全新应用程序的配置文件与现有应用程序进行比较。

于 2013-01-08T23:54:53.730 回答
1

The Railsdiff.org site can provide the difference between the contents of a vanilla Rails project (ie as if running Rails New) between any two versions of Rails going back to 3.0.0. I find this particularly useful to determine if there have been any changes to the standard configuration options between versions or if there are new files added/removed from a standard project which you may want to copy over to your existing project.

This won't provide any insight into what has changed in the framework itself, for that you'll need to jump into the change logs for each release. Easiest way to pick them up is check out the Ruby on Rails blog which includes notes and links for each released version.

于 2013-01-09T04:15:55.257 回答