将 Rails 3.0.3 更新到 3.0.5 [英] Updating Rails 3.0.3 to 3.0.5

查看:29
本文介绍了将 Rails 3.0.3 更新到 3.0.5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我没有任何更新 Rails 应用程序的经验,当我用谷歌搜索它时,它只显示了如何将 Rails 2.x 更新到 3.0.x 的复杂方法.所以我的问题要简单一些.

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. So my issue is a bit simpler.

到目前为止我试过这个:

So far I tried this:

  1. 编辑 Gemfile 并更改为 3.0.5
  2. 捆绑安装

然后在相关的 gemset 中您会看到所有 rails 3.0.5 和 3.0.3 gems.

Then in the related gemset you see all rails 3.0.5 and 3.0.3 gems.

  1. 这是通常的方式吗?
  2. 我应该移除所有 3.0.3 gems 吗?
  3. 有没有更好的方法来更新 Rails 应用程序?

推荐答案

是的,更新 Gemfile 并运行 bundle install 是更新应用程序的正确方法.gem update rails 只会将新的 gem 安装到您的系统中(与 bundler 一样).

Yes, updating the Gemfile and running bundle install is the right way to update an app. gem update rails will just install the new gem to your system (the same as bundler will do).

虽然从 3.0.3 到 3.0.5 的更新不需要,但在更新 Rails 应用程序时,您应该注意 rake rails:update.如果您没有密切关注可能发生的配置更改并且正在更新多个版本的应用,这将非常有用.

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. 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.

这将帮助您找出应用程序中的启动和环境文件中是否有任何需要更改的内容,但如果您更愿意只处理您在日志中看到的任何弃用警告,则可以忽略它.除非你想在你的 scm 中做很多恢复,否则我建议每次说有冲突时按d"(差异),然后扫描一下看看是否有任何变化并需要更新.

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.

关于如何处理旧宝石.这完全取决于你.如果你想保留它们,如果你不想卸载它们.无论哪种方式都可以正常工作.

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.

这篇关于将 Rails 3.0.3 更新到 3.0.5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆