简体   繁体   English

从Rails 3.0.3更新到3.0.10的最安全方法是什么?

[英]what is safest way to update from rails 3.0.3 to 3.0.10?

My production app is running on ruby 1.9.2 and rail 3.0.3. 我的生产应用程序在ruby 1.9.2和rail 3.0.3上运行。

What is the safest method to upgrade rails to 3.0.10, and is upgrading to rails 3.0.10 completely safe, or do I run the risk of some gem dependencies breaking something? 将Rails升级到3.0.10的最安全方法是什么,并且完全安全地升级到Rails 3.0.10的方法是什么,还是冒着某些gem依赖项破坏某些东西的风险?

I had good success with the following approach: 我通过以下方法取得了成功:

  1. Ensure that all your files that are relevant for development and production are in source control (preferably Git). 确保与开发和生产相关的所有文件都在源代码控制(最好是Git)中。
  2. Ensure that your current 3.0.3 status is clean, everything is commited. 确保您当前的3.0.3状态是干净的,所有内容都已提交。
  3. Make a branch on that. 在那做一个分支。
  4. Upgrade your Gemfile to ensure that the Rails version is upgrade to 3.0.10. 升级您的Gemfile以确保将Rails版本升级到3.0.10。
  5. Do the normal bundle install tasks. 执行正常的bundle install任务。
  6. Do your tests as usual (you do have tests, no :-)). 像往常一样进行测试(您确实有测试,没有:-))。
  7. Look for warnings and errors in the log. 在日志中查找警告和错误。
  8. If everything works fine, commit your changes, and switch back to your master. 如果一切正常,请提交更改,然后切换回主服务器。
  9. Merge the changes and do then a normal delivery (not part of my answer). 合并更改,然后正常交付(不是我的回答的一部分)。

Depending on the data you have in production, there may be extra steps necessary, but normally, you don't change any functionality, you just upgrade the Rails version, so normally no migration change is necessary. 根据生产中的数据,可能需要一些额外的步骤,但是通常,您无需更改任何功能,只需升级Rails版本,因此通常无需进行任何迁移。

PS: The real job then is to upgrade to Rails 3.1.x ... PS:然后,真正的工作就是升级到Rails 3.1.x ...

The safest way is to do it first on a staging server first. 最安全的方法是先在登台服务器上执行此操作。 Other than that I didn't see anything bad in 3.0.x Rails, but I was small doing incremental upgrades mostly. 除此之外,在3.0.x Rails中我没有发现任何问题,但是我很少进行增量升级。

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

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