문제

We use Ubuntu 12.04 TLS, Ruby 1.9.3, Rails 3.2.12, and RVM on our production server.

We want to upgrade Ruby from 1.9.3 to 2.2 (or whatever the latest one is), without updating Rails.

I have three questions:

  1. Are there any caveats in doing that, any inconsistensies, deprecated methods? Is there any chance that site will stop working?
  2. Considering that we are using RVM, would it be possible to get back to the version we are using right now (if anything goes wrong)?
  3. Would it be necessary to re-install all the gems that we are using right now?

Thanks in advance!

도움이 되었습니까?

해결책

Always presume the whole machine is going to be trashed beyond repair by this process. Prepare for the worst, hope for the best. If you don't have a test machine, you can build one with a tool like Vagrant. Once you have a procedure that works, repeat it on your production system.

Ruby 2.1.1 is the current version. You'll also want to look at upgrading Rails itself to avoid a bunch of nasty vulnerabilities. 3.2.17 is the version to target here.

RVM does make it easier to upgrade things, but you'll also need to upgrade your launcher (e.g. Passenger) to use the newer Ruby version. Yes, it is possible to back out, but this is not always convenient.

One trick that might help rescue from disaster is checking your /etc directory into a local Git repository. This allows you to rollback any configuration changes you make, as well as see what changes you've actually made through the course of your upgrades.

Any change to the base Ruby version does require re-installing all gems. If you're using Bundler or an automated deployment tool this should be fairly automatic.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top