Useful links for Rails Upgrade

Tools, guides, tips, checklists and other helpful info for Rails update
19 June 2017   2790

New RoR release brings many new features, better security, and increased performance. But depending on many factors, it's often not easy to upgrade your version. When you finally decided, you want it to be fast and safe.

In order to make update process comfortable, here is the list helpful tools, guides, checklists and other resources about updating Ruby. Some of them are related only for 4.x or 5.x, other are universal.

Universal resources

Ruby on Rails

Framework written in the Ruby programming language
 

Ruby

Dynamic, open source programming language with a focus on simplicity and productivity

List of the resources, that will help with update of any version.

Rails Official Release Guides

rails guidesRailsGuides interface

First place you should begin to search info about Rails update is the official release guides. With the newest version of Rails new guide is also uploaded. Guides are available from 3.0 up to 5.1. These materials are useful for covering the basic changes of each version and for handy tips. 

Rails Upgrate Checklist

Rails Upgrate Checklist
Rails Upgrade Checklist interface

Rails Upgrade Checklist is one of the most useful resources for anyone, who needs his Rails to be updated. Provides a starting point and helps to plan steps of your Rails update, depending on a version. At the moment, this check list is only for Rails 4 or lower. You can create pull requests to update the list here

RailsDiff

RailsDiff interface
RailsDiff interface

Very useful resource, that helps to find Rails documentation for each release. It covers all Rails code change from 2.3.6 to 5.1.1. Website provides line by line demonstration of changes in Rails app. For every separate Gem you use, you will have to make a test in your app. For someone that faced first update or for someone with no clue where to begin, RailsDiff is great tool.

Stackoverflow

StackoverflowStackoverflow interface

Stackoverflow is well known as a helping resource, driven by community. Here you can ask any questions, regarding Ruby and Rails. Also, there's a lot of ready-made answers for every issue. For example, big thread about update from 4.2.6 to 5.0.

Reddit

Rails section at Reddit
Rails section at Reddit

Same as StackOverflow, Reddit is community driven resources with answers to large amount of web development issues. It has Rails community, when you can ask both technical and career questions, Rails update issues is not exception. 

Updating to Rails 5.x

Next links will be helpful for those, who plans to upgrade their Rails to version 5.0 or higher.

Is a gem ready for Rails 4 or 5?

ready4rails interface
Ready4rails interface

By using this interesting website, you can figure out, are your key gems ready for upgrade or not. You can find what gems will cause conflicts and which ones are ready for upgrade. If some of your gems aren't ready for an update, it's good to wait for an update then look for another solution.

To stay updated on security files and other updates, you can use VersionEye tool. This solution checks your Git repository and informs you with any changes. 

Updating to Rails 5.0 by Daniel Kehoe

Updating to Rails 5.0 by Daniel Kehoe
Updating to Rails 5.0 by Daniel Kehoe

This big article-tutorial covers the topic of using RVM for managing of Rails version. You are free to use chruby or rbenv or you can follow exactly for Ruby Version Manager.

Rails 4.x and higher upgrade

If your Rails are few versions below, it is necessary to upgrade them. The easiest way is to  go version by version. Here are some helpful resources for apps, that are on 3.x version.

Book "Upgrade to Rails 4" by Philip De Smedt

Upgrade to Rails 4
"Upgrade to Rails 4" cover

This ebook includes 32 chapters on different Rails 4 features, along with a detailed checklist for upgrading. It is good to have all necessary info by the hand when you are doing an update.

Screencast "Upgrading to Rails 4" 

Upgrading to Rails 4 screencast 
Upgrading to Rails 4 screencast 

RailsCast is great resource for those, who like to learn visual. If you're updating your Rails to 4.x, RailCast created a screencast displaying the process for updating. The video takes you through the spots with main changes, and you can watch in real time.

How to Upgrade to Rails 4.2 by Justin Weiss

How to Upgrade to Rails 4.2 by Justin Weiss webpage
How to Upgrade to Rails 4.2 by Justin Weiss webpage

Justin provides some good tips for upgrading a Rails app to version 4.2. This tutorial shortly covers testing, Rails gem updates, and more. It doesn’t dig into the deep details, but is a good proffesional view of the best strategy for upgrading.

How To Upgrade a Big Legacy App to Rails 4

HOW TO UPGRADE A BIG LEGACY APP TO RAILS 4 webpage
How To Upgrade a Big Legacy App to Rails 4 webpage

If you’re planning an upgrade for a big app, this article will give you overview how one team did it. This covers the creating of the development team, how good planning played a big role in the update, and the technical updates that were made along the way. If your team isn’t planning an update, this article also helps explain resource allocation and how features and technical stuff were balanced. 

When I update rails, my go-to solution is Rails Diff. Also Rails Guides is a must-see resource since it’s written by the new features authors. Stackoverflow happens all the time since many gems are not so up to date, so sometimes Google sends me there first. Never used reddit btw.
 

Dima Koprov
Team Lead at Evrone

What link was the most useful for you?

RailsDiff
100% (1 vote)
Rails Official Release Guides
0% (0 votes)
Rails Upgrate Checklist
0% (0 votes)
Stackoverflow
0% (0 votes)
Reddit
0% (0 votes)
Updating to Rails 5.0 by Daniel Kehoe
0% (0 votes)
Is a gem ready for Rails 4 or 5?
0% (0 votes)
Book “Upgrade to Rails 4” by Philip De Smedt
0% (0 votes)
Screencast “Upgrading to Rails 4”
0% (0 votes)
How to Upgrade to Rails 4.2 by Justin Weiss
0% (0 votes)
How To Upgrade a Big Legacy App to Rails 4
0% (0 votes)
Total votes: 1

Charles Nutter. How to move your Ruby project to JRuby and why

Charles Nutter works on JRuby and JVM language support at Red Hat.
03 October 2018   1196

— How did you get into programming and into Ruby world?

— In 2004, I was working at a government contracting firm as a Java Enterprise Architect. I was in charge of a large mainframe conversion for the United States Department of Agriculture, which meant I spent a couple weeks a month in the Washington D.C. area. One of those trips coincided with RubyConf 2004, and since a close friend had been recommending I look at Ruby, I decided to attend. So there I was sitting in a Ruby conference without ever having learned Ruby...and I understood every piece of code, every example. I was amazed and vowed to find a way to bring Ruby into my Java world.

— Which projects are you working on now?

— My primary role is as co-lead of JRuby. This also means supporting several side projects like our native-library backend (Ruby's FFI library is maintained by us using this backend on JRuby) and our String encoding subsystem (an elaborate port of the logic from CRuby). I also do much of the outreach to the community and try to make sure our users are getting their issues addressed. There's always plenty to work on!

— Which one would have the biggest general impact from you opinion?

— I like to think that JRuby, while not the most popular JVM language, has at least helped to change the JVM platform. Because of our collaborations with Sun Microsystems, Oracle, and others, we have solid dynamic language support at the JVM level along with many other projects to support alternative languages. The JVM today is a much more hospitable home for non-Java languages than it used to be, and I hope we've played some small part in that change.

— Which languages are you writing on in your everyday life? Which one do you like most? Why?

— Most days I write in a mix of Ruby and Java, since JRuby is implemented using both. I like both languages for different tasks. Ruby is a better language for building applications that need to evolve and adapt quickly. Java is a great language for writing high-speed, reliable libraries and services. JRuby gives you the best of both worlds!

— Do you like to program in Java?

— I do, especially with all the language improvements that have been added recently, like lambdas (closures or blocks in Ruby) and the new "var" syntax for declaring local variables when the static type is unambiguous.

— What do you think about Rust?

— Rust is a great language! I did a lot of C++ development in my college years, and I can tell you right now if I'd had Rust available then I would have used it. I'm especially jealous of the static-typed ownership model, which helps avoid thread-safety issues like races and data corruption. I hope to see other languages adopt this pattern in the future.

— What do you think about the Ruby language perspective? Is it or its community dying?

— After all these years working on JRuby, I do still love Ruby syntax and the Ruby way of doing things. However I worry that the language is held back too much by limitations of its primary runtime. JRuby has been fighting to make true parallel threading a reality for Ruby developers, but still today the vast majority of Ruby services are run using multiple isolated processes, wasting tremendous amounts of CPU and memory resources. I believe this is due to the C API for writing Ruby extensions being so large and so invasive...it prevents many improvements -- including parallel threading -- from being developed. Hopefully we'll see this change some day.

— Which upcoming or not well-known features of Ruby language would rush in future?

— I look forward to strings becoming immutable-by-default, as they are in most other languages. Parallel programming would be much simpler if more of Ruby's objects supported pure-immutable or "deep freeze" semantics. It's a bit like the Rust ownership model...if you're going to be sharing an object across threads, choose the version of that object that you know can't be modified anymore. This extends to arrays, hashes, and just about every other mutable object in Ruby: we need to make it easier to lock down mutable data.

— Could you give me an advice on how to move my ancient monolithic project to JRuby? And should I?

— The first question really is whether such a move would benefit you. There's many good reasons to consider a move to JRuby:

  • Reducing CPU  and memory costs in a shared hosting environment by utilizing JRuby's true parallel threading
  • Deploying a Ruby application into a JVM-heavy environment, such as used by larger financial or government organizations
  • Needing access to libraries that only exist on the JVM, or that are more portable or scalable on the JVM than their Ruby or C equivalents
  • Getting a little performance boost out of CPU-heavy or concurrency-heavy applications.

— I would say if your application is scaling well and not costing you too much today, perhaps you don't need to make a move. But if you decide you need more out of Ruby, here's the process for migrating:

  • Do a clean bundle of your application, paying special attention to C extensions you may be using. You can also do this bundling *on* JRuby, and then deal with missing or unsupported libraries one by one.
  • For each extension, search for a JRuby equivalent. We have some pages on the JRuby wiki to help with this. Most popular libraries have JRuby versions. If no JRuby version exists, you may look for a pure-Ruby version (it might be fast enough on JRuby) or a JVM library (in Java or Scala or Clojure or whatever) that could be used as a replacement.
  • Once your bundle completes, you should have a working JRuby application! We've worked very hard on compatibility, and try to be responsive if users find new issues, but a successfully-bundled application is expected to work.

The steps beyond this involve deciding how to take advantage of your newfound power: how many threads to throw at a given server, what you're going to do with all the money you're saving, etc.

— What should nowadays students learn to become good programmers?

— When I was at university, my earliest computer science courses used the Scheme language, a Lisp-like functional language that's great for teaching the fundamentals of programming. I still recommend that serious new programmers work through at least some of the Structure and Interpretation of Computer Programs book from MIT. Beyond that, I'd say learn as many different and unusual languages as you can; they'll all give you new ideas and new ways to look at programming problems.

— How do you keep yourself motivated for programming? Have you ever been "burned-out"?

— Burn-out is a real problem in our industry, and working in open source brings with it huge amount of stress. We've all felt that way sometimes...too much work to do and not enough time to do it, missing out on time with family and friends, ignoring our own health so we can fix one more bug. These days I try to center myself by keeping up with hobbies: playing video and board games, learning to play guitar, studying foreign languages, and traveling around the world to meet new friends. There's always this nagging workaholic telling me to get back on the job, but I'm learning how to maintain the right balance.

— What do you think about Russia and what do you expect of the upcoming RubyRussia event?

— I love Russia, and my speaking trips the past few years have been some of the most rewarding of my life. This will be my fourth visit, having been to Saint-Petersburg, Moscow, and Novosibirsk (!!!) previously. I'm looking forward to returning to Moscow and meeting the RubyRussia community I've heard so much about!

Questions by Dmitry Matveyev PM at Evrone https://www.facebook.com/matveyev.d