简体   繁体   English

将Rails 3.0.3更新到3.0.5

[英]Updating Rails 3.0.3 to 3.0.5

I don't have any experience in updating a Rails app and when I google it, it shows only complex ways how to update Rails 2.x to 3.0.x. 我没有任何更新Rails应用程序的经验,当我谷歌它时,它只显示了如何将Rails 2.x更新到3.0.x的复杂方法。 So my issue is a bit simpler. 所以我的问题有点简单。

So far I tried this: 到目前为止我试过这个:

  1. Edited the Gemfile and change to 3.0.5 编辑Gemfile并更改为3.0.5
  2. bundle install 捆绑安装

Then in the related gemset you see all rails 3.0.5 and 3.0.3 gems. 然后在相关的gemset中,您会看到所有rails 3.0.5和3.0.3 gems。

  1. Is this the usual way? 这是通常的方式吗?
  2. Should I remove all 3.0.3 gems? 我应该删除所有3.0.3宝石吗?
  3. Is there a better way to update a rails app? 有没有更好的方法来更新rails应用程序?

Yes, updating the Gemfile and running bundle install is the right way to update an app. 是的,更新Gemfile并运行bundle install是更新应用程序的正确方法。 gem update rails will just install the new gem to your system (the same as bundler will do). gem update rails只会将新gem安装到您的系统中(与bundler一样)。

Though not needed for an update from 3.0.3 to 3.0.5, you should be aware of rake rails:update , when updating Rails apps. 虽然从3.0.3到3.0.5的更新不需要,但在更新Rails应用程序时,您应该注意rake rails:update It's useful if you haven't been keeping an eye on what configuration changes may have happened and are updating an app up a number of versions. 如果您没有密切关注可能发生的配置更改并且正在更新多个版本的应用程序,这将非常有用。

This will help you to find out if there are any things which need changing in the boot and environment files which are in the app, but can be ignored if you prefer to just deal with any deprecation warnings you see in the logs instead. 这将帮助您确定应用程序中的引导和环境文件中是否存在任何需要更改的内容,但如果您希望仅处理日志中显示的任何弃用警告,则可以忽略这些内容。 Unless you want to do a lot of reverting in your scm, I'd recommend to press 'd' (for diff) each time it says there's a conflict and then just have a scan through to see if anything has changed and needs updating. 除非你想在你的scm中进行大量的还原,否则我建议每次出现冲突时按'd'(差异),然后只需扫描一下,看看是否有任何变化并需要更新。

With regards to what to do with the old gem. 关于如何处理旧宝石。 It's completely up to you. 这完全取决于你。 Keep them if you want, uninstall them if you don't. 如果需要,请保留它们,如果不需要,请将其卸载。 It'll work fine either way. 无论哪种方式都可以。

这是一个很好的指南 - http://railsapps.github.com/updating-rails.html .....

Just execute: gem update rails 只需执行: gem update rails

You should not remove 3.0.3 gems. 你不应该删除3.0.3宝石。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM