ATLRUG - Upgrading Rails (Isn't So Bad)

ATLRUG - Upgrading Rails (Isn't So Bad)

Full-length version of my lightning talk from Rails Girls 6/29/16. Given on 7/13/16 at the Atlanta Ruby Users Group.

Upgrading Rails gets a bad rap, but it doesn't have to be so daunting if we listen to our tools and remember that we're in control.

817f5f1ada5fdeffcd14668107c08f0a?s=128

Megan Tiu

July 13, 2016
Tweet

Transcript

  1. Upgrading Rails (Isn’t So Bad) Megan Tiu Atlanta Ruby Users

    Group July 13, 2016
  2. Hello there megandtiu megantiu megan@megantiu.com megantiu.com

  3. RailsConf

  4. Why upgrade?

  5. Why upgrade? • Speed • Security • Fun! • Up-to-date

    apps are easier to maintain
  6. When should I upgrade?

  7. When should I upgrade? • The larger your app, the

    later you should wait ◦ Bug fix patches will follow shortly ◦ Not all dependencies will be ready for Rails 5 • Smaller apps with few dependencies will likely be ready
  8. It’s not so scary

  9. 0. Create a new branch

  10. $ git checkout -b rails5

  11. 1. Start with a clean test suite

  12. 1. Start with a clean test suite • No deprecation

    warnings • All tests passing • As many gems up-to-date as possible
  13. None
  14. 2. Bundle update

  15. gem ‘rails’, ~> ‘5.0.0’ # Gemfile

  16. $ bundle update rails

  17. 3. Don’t panic!

  18. None
  19. 4. Update the offending gem

  20. None
  21. gem ‘rspec-rails’, ~> ‘3.5.0.beta4’ # Gemfile

  22. gem ‘rspec-rails’, ~> ‘3.5.0.beta4’ # Gemfile Must specify for pre-release

    versions (.rc, .beta)
  23. $ bundle update rails rspec-rails

  24. 5. We’re still not panicking

  25. None
  26. None
  27. To GitHub!

  28. gem ‘exception_notification’, github: ‘smartinez87/exception_notification’, branch: ‘rails5’ # Gemfile

  29. $ bundle update rails rspec-rails exception_notification

  30. 6. !!!

  31. None
  32. Time to commit!

  33. 7. Make your tests pass

  34. None
  35. 8. Deprecation warnings, be gone!

  36. Use these...

  37. To achieve this!

  38. 9. Celebrate!

  39. None
  40. Takeaways and tips: • Break dependency upgrades into chunks •

    Read your gems’ changelogs • Look up your deprecation warnings • Error messages are your friend • You are in control
  41. You are in control

  42. http://megantiu.com/blog/8/upgrading-rails- doesnt-have-to-be-painful

  43. https://speakerdeck.com/derekprior/keep- rails-upgraded

  44. Looking for opportunities! megandtiu megantiu megan@megantiu.com megantiu.com