{"id":72,"date":"2020-12-04T16:02:55","date_gmt":"2020-12-04T16:02:55","guid":{"rendered":"https:\/\/manishshrivastava.com\/blog\/?p=72"},"modified":"2020-12-05T14:14:38","modified_gmt":"2020-12-05T14:14:38","slug":"to-upgrade-ruby-1-8-7-to-ruby-2-7-and-rails-3-to-rails-6-0","status":"publish","type":"post","link":"https:\/\/manishshrivastava.com\/blog\/to-upgrade-ruby-1-8-7-to-ruby-2-7-and-rails-3-to-rails-6-0\/","title":{"rendered":"To upgrade ruby 2.x to ruby 2.7 and rails 4.x to rails 6.0"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/manishshrivastava.com\/blog\/wp-content\/uploads\/2020\/12\/markus-winkler-cxoR55-bels-unsplash-1024x683.jpg\" alt=\"Ruby on Rails update\" class=\"wp-image-73\" \/><\/figure>\n\n\n\n<p>It&#8217;s very rare to directly update from ruby 1.8.7 or ruby 2.0 to <a href=\"https:\/\/www.ruby-lang.org\/en\/news\/2019\/12\/25\/ruby-2-7-0-released\/\">ruby 2.7<\/a> and rails 4 to <a href=\"https:\/\/rubygems.org\/gems\/rails\/versions\">rails 6.0<\/a>.  As I have recently done many upgrade projects from legacy ruby code to new ruby code. So, I thought to help other developers too.<\/p>\n\n\n\n<h2>How?<\/h2>\n\n\n\n<p>To do so, I have got the advantage of working from Ruby 2.x to the current version of ruby to I know each and everything from legacy plugin development age to gems and then gems to new replaced gems(if depreciated).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What?<\/h2>\n\n\n\n<p>For a small project, I would rather suggest installing a fresh project in the latest ruby and latest rails there. Now, I will replace the app folder of the old code into a new project.<\/p>\n\n\n\n<p>also, I will keep adding configurations carefully as it&#8217;s mainly updated.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">GEMS:<\/h2>\n\n\n\n<p>Regarding other gems, go to their GitHub documentation and check if the community is active (check using the last commit), if yes then you can install with their latest version without setting the gem version. i.e. <code>gem install devise  and add <a href=\"https:\/\/github.com\/heartcombo\/devise\">gem 'devise'<\/a><\/code> in your Gemfile.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Migration<\/strong>:<\/h2>\n\n\n\n<p>and most important is the GEMS, from the old file, remove all ruby and rails related gems to transfer as new rails is already installed.<\/p>\n\n\n\n<p>In migrations, you will have to add `[6.0]` <a href=\"https:\/\/edgeguides.rubyonrails.org\/active_record_migrations.html\">in migration<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong><strong>Webpacker update<\/strong><\/strong>:<\/h2>\n\n\n\n<p> Ideally, we should use webpacker with rails 6, but As most clients don&#8217;t give time to re-write the javascript code with webpacker. So, It&#8217;s better to use normal javascript as in-app\/assets folder. <\/p>\n\n\n\n<p><strong>And<\/strong><\/p>\n\n\n\n<p><em>For better projects management, we should follow the process:<\/em><\/p>\n\n\n\n<ol><li>Prepare the List of Decreciated gems. Identify all possible new gems which can be used also if required or not.<\/li><li>Prepare the documentation of changes required.<\/li><li>Prepare the timelines accordingly.<\/li><li>Work on ROR update as per your plan.<\/li><li>Always use another branch for any kind of upgrades. and never use the master branch for an upgrade.<\/li><li>Try to write the test cases as well so that you will be sure about the functionality is working properly.<\/li><\/ol>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"374\" src=\"https:\/\/manishshrivastava.com\/blog\/wp-content\/uploads\/2020\/12\/ror-1024x374.jpeg\" alt=\"ruby on rails\" class=\"wp-image-76\" srcset=\"https:\/\/manishshrivastava.com\/blog\/wp-content\/uploads\/2020\/12\/ror-1024x374.jpeg 1024w, https:\/\/manishshrivastava.com\/blog\/wp-content\/uploads\/2020\/12\/ror-300x110.jpeg 300w, https:\/\/manishshrivastava.com\/blog\/wp-content\/uploads\/2020\/12\/ror-768x280.jpeg 768w, https:\/\/manishshrivastava.com\/blog\/wp-content\/uploads\/2020\/12\/ror-1536x561.jpeg 1536w, https:\/\/manishshrivastava.com\/blog\/wp-content\/uploads\/2020\/12\/ror-1170x427.jpeg 1170w, https:\/\/manishshrivastava.com\/blog\/wp-content\/uploads\/2020\/12\/ror.jpeg 1920w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Feel free to let me know if you face any issue or wish me to work on your ruby on rails update. I will be happy to assist.<\/p>\n\n\n\n<p>Thanks,<\/p>\n\n\n\n<p>Manish S<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s very rare to directly update from ruby 1.8.7 or ruby 2.0 to ruby 2.7 and rails 4 to rails 6.0. As I have recently done many upgrade projects from legacy ruby code to new ruby code. So, I thought to help other developers too. How? To do so, I have got the advantage of &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/manishshrivastava.com\/blog\/to-upgrade-ruby-1-8-7-to-ruby-2-7-and-rails-3-to-rails-6-0\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;To upgrade ruby 2.x to ruby 2.7 and rails 4.x to rails 6.0&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[20,19,21,17,18],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.8.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>To upgrade ruby 2.x to ruby 2.7 and rails 4.x to rails 6.0 - Manish Blog<\/title>\n<meta name=\"description\" content=\"As I have recently done many upgrade projects from legacy ruby code to new ruby code. So, I thought to help other developers too. Click here to see how?\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/manishshrivastava.com\/blog\/to-upgrade-ruby-1-8-7-to-ruby-2-7-and-rails-3-to-rails-6-0\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Manish Blog\" \/>\n<meta property=\"og:description\" content=\"As I have recently done many upgrade projects from legacy ruby code to new ruby code. So, I thought to help other developers too. Click here to see how?\" \/>\n<meta property=\"og:url\" content=\"https:\/\/manishshrivastava.com\/blog\/to-upgrade-ruby-1-8-7-to-ruby-2-7-and-rails-3-to-rails-6-0\/\" \/>\n<meta property=\"og:site_name\" content=\"Manish Blog\" \/>\n<meta property=\"article:published_time\" content=\"2020-12-04T16:02:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-12-05T14:14:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/manishshrivastava.com\/blog\/wp-content\/uploads\/2020\/12\/markus-winkler-cxoR55-bels-unsplash-1024x683.jpg\" \/>\n<meta name=\"author\" content=\"manish shrivastava\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Manish Blog\" \/>\n<meta name=\"twitter:description\" content=\"As I have recently done many upgrade projects from legacy ruby code to new ruby code. So, I thought to help other developers too. Click here to see how?\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/manishshrivastava.com\/blog\/wp-content\/uploads\/2020\/12\/update-scaled.jpg\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"manish shrivastava\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/manishshrivastava.com\/blog\/to-upgrade-ruby-1-8-7-to-ruby-2-7-and-rails-3-to-rails-6-0\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/manishshrivastava.com\/blog\/to-upgrade-ruby-1-8-7-to-ruby-2-7-and-rails-3-to-rails-6-0\/\"},\"author\":{\"name\":\"manish shrivastava\",\"@id\":\"https:\/\/manishshrivastava.com\/blog\/#\/schema\/person\/19d0df1c38b86606412b5c821e67e67e\"},\"headline\":\"To upgrade ruby 2.x to ruby 2.7 and rails 4.x to rails 6.0\",\"datePublished\":\"2020-12-04T16:02:55+00:00\",\"dateModified\":\"2020-12-05T14:14:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/manishshrivastava.com\/blog\/to-upgrade-ruby-1-8-7-to-ruby-2-7-and-rails-3-to-rails-6-0\/\"},\"wordCount\":367,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/manishshrivastava.com\/blog\/#\/schema\/person\/19d0df1c38b86606412b5c821e67e67e\"},\"keywords\":[\"cheatsheet\",\"rails\",\"rails udpate\",\"ruby\",\"update ruby\"],\"articleSection\":[\"upgrade\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/manishshrivastava.com\/blog\/to-upgrade-ruby-1-8-7-to-ruby-2-7-and-rails-3-to-rails-6-0\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/manishshrivastava.com\/blog\/to-upgrade-ruby-1-8-7-to-ruby-2-7-and-rails-3-to-rails-6-0\/\",\"url\":\"https:\/\/manishshrivastava.com\/blog\/to-upgrade-ruby-1-8-7-to-ruby-2-7-and-rails-3-to-rails-6-0\/\",\"name\":\"To upgrade ruby 2.x to ruby 2.7 and rails 4.x to rails 6.0 - Manish Blog\",\"isPartOf\":{\"@id\":\"https:\/\/manishshrivastava.com\/blog\/#website\"},\"datePublished\":\"2020-12-04T16:02:55+00:00\",\"dateModified\":\"2020-12-05T14:14:38+00:00\",\"description\":\"As I have recently done many upgrade projects from legacy ruby code to new ruby code. So, I thought to help other developers too. Click here to see how?\",\"breadcrumb\":{\"@id\":\"https:\/\/manishshrivastava.com\/blog\/to-upgrade-ruby-1-8-7-to-ruby-2-7-and-rails-3-to-rails-6-0\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/manishshrivastava.com\/blog\/to-upgrade-ruby-1-8-7-to-ruby-2-7-and-rails-3-to-rails-6-0\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/manishshrivastava.com\/blog\/to-upgrade-ruby-1-8-7-to-ruby-2-7-and-rails-3-to-rails-6-0\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/manishshrivastava.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"upgrade\",\"item\":\"https:\/\/manishshrivastava.com\/blog\/category\/upgrade\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"To upgrade ruby 2.x to ruby 2.7 and rails 4.x to rails 6.0\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/manishshrivastava.com\/blog\/#website\",\"url\":\"https:\/\/manishshrivastava.com\/blog\/\",\"name\":\"Manish Blog\",\"description\":\"Rubyist, Realist, Pragmatist, and Believer\",\"publisher\":{\"@id\":\"https:\/\/manishshrivastava.com\/blog\/#\/schema\/person\/19d0df1c38b86606412b5c821e67e67e\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/manishshrivastava.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/manishshrivastava.com\/blog\/#\/schema\/person\/19d0df1c38b86606412b5c821e67e67e\",\"name\":\"manish shrivastava\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/manishshrivastava.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8d35275f95d1cd3202c89c1693336453?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/8d35275f95d1cd3202c89c1693336453?s=96&d=mm&r=g\",\"caption\":\"manish shrivastava\"},\"logo\":{\"@id\":\"https:\/\/manishshrivastava.com\/blog\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/99interview.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"To upgrade ruby 2.x to ruby 2.7 and rails 4.x to rails 6.0 - Manish Blog","description":"As I have recently done many upgrade projects from legacy ruby code to new ruby code. So, I thought to help other developers too. Click here to see how?","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/manishshrivastava.com\/blog\/to-upgrade-ruby-1-8-7-to-ruby-2-7-and-rails-3-to-rails-6-0\/","og_locale":"en_US","og_type":"article","og_title":"Manish Blog","og_description":"As I have recently done many upgrade projects from legacy ruby code to new ruby code. So, I thought to help other developers too. Click here to see how?","og_url":"https:\/\/manishshrivastava.com\/blog\/to-upgrade-ruby-1-8-7-to-ruby-2-7-and-rails-3-to-rails-6-0\/","og_site_name":"Manish Blog","article_published_time":"2020-12-04T16:02:55+00:00","article_modified_time":"2020-12-05T14:14:38+00:00","og_image":[{"url":"https:\/\/manishshrivastava.com\/blog\/wp-content\/uploads\/2020\/12\/markus-winkler-cxoR55-bels-unsplash-1024x683.jpg"}],"author":"manish shrivastava","twitter_card":"summary_large_image","twitter_title":"Manish Blog","twitter_description":"As I have recently done many upgrade projects from legacy ruby code to new ruby code. So, I thought to help other developers too. Click here to see how?","twitter_image":"https:\/\/manishshrivastava.com\/blog\/wp-content\/uploads\/2020\/12\/update-scaled.jpg","twitter_misc":{"Written by":"manish shrivastava","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/manishshrivastava.com\/blog\/to-upgrade-ruby-1-8-7-to-ruby-2-7-and-rails-3-to-rails-6-0\/#article","isPartOf":{"@id":"https:\/\/manishshrivastava.com\/blog\/to-upgrade-ruby-1-8-7-to-ruby-2-7-and-rails-3-to-rails-6-0\/"},"author":{"name":"manish shrivastava","@id":"https:\/\/manishshrivastava.com\/blog\/#\/schema\/person\/19d0df1c38b86606412b5c821e67e67e"},"headline":"To upgrade ruby 2.x to ruby 2.7 and rails 4.x to rails 6.0","datePublished":"2020-12-04T16:02:55+00:00","dateModified":"2020-12-05T14:14:38+00:00","mainEntityOfPage":{"@id":"https:\/\/manishshrivastava.com\/blog\/to-upgrade-ruby-1-8-7-to-ruby-2-7-and-rails-3-to-rails-6-0\/"},"wordCount":367,"commentCount":0,"publisher":{"@id":"https:\/\/manishshrivastava.com\/blog\/#\/schema\/person\/19d0df1c38b86606412b5c821e67e67e"},"keywords":["cheatsheet","rails","rails udpate","ruby","update ruby"],"articleSection":["upgrade"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/manishshrivastava.com\/blog\/to-upgrade-ruby-1-8-7-to-ruby-2-7-and-rails-3-to-rails-6-0\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/manishshrivastava.com\/blog\/to-upgrade-ruby-1-8-7-to-ruby-2-7-and-rails-3-to-rails-6-0\/","url":"https:\/\/manishshrivastava.com\/blog\/to-upgrade-ruby-1-8-7-to-ruby-2-7-and-rails-3-to-rails-6-0\/","name":"To upgrade ruby 2.x to ruby 2.7 and rails 4.x to rails 6.0 - Manish Blog","isPartOf":{"@id":"https:\/\/manishshrivastava.com\/blog\/#website"},"datePublished":"2020-12-04T16:02:55+00:00","dateModified":"2020-12-05T14:14:38+00:00","description":"As I have recently done many upgrade projects from legacy ruby code to new ruby code. So, I thought to help other developers too. Click here to see how?","breadcrumb":{"@id":"https:\/\/manishshrivastava.com\/blog\/to-upgrade-ruby-1-8-7-to-ruby-2-7-and-rails-3-to-rails-6-0\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/manishshrivastava.com\/blog\/to-upgrade-ruby-1-8-7-to-ruby-2-7-and-rails-3-to-rails-6-0\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/manishshrivastava.com\/blog\/to-upgrade-ruby-1-8-7-to-ruby-2-7-and-rails-3-to-rails-6-0\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/manishshrivastava.com\/blog\/"},{"@type":"ListItem","position":2,"name":"upgrade","item":"https:\/\/manishshrivastava.com\/blog\/category\/upgrade\/"},{"@type":"ListItem","position":3,"name":"To upgrade ruby 2.x to ruby 2.7 and rails 4.x to rails 6.0"}]},{"@type":"WebSite","@id":"https:\/\/manishshrivastava.com\/blog\/#website","url":"https:\/\/manishshrivastava.com\/blog\/","name":"Manish Blog","description":"Rubyist, Realist, Pragmatist, and Believer","publisher":{"@id":"https:\/\/manishshrivastava.com\/blog\/#\/schema\/person\/19d0df1c38b86606412b5c821e67e67e"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/manishshrivastava.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/manishshrivastava.com\/blog\/#\/schema\/person\/19d0df1c38b86606412b5c821e67e67e","name":"manish shrivastava","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/manishshrivastava.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/8d35275f95d1cd3202c89c1693336453?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8d35275f95d1cd3202c89c1693336453?s=96&d=mm&r=g","caption":"manish shrivastava"},"logo":{"@id":"https:\/\/manishshrivastava.com\/blog\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/99interview.com"]}]}},"_links":{"self":[{"href":"https:\/\/manishshrivastava.com\/blog\/wp-json\/wp\/v2\/posts\/72"}],"collection":[{"href":"https:\/\/manishshrivastava.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/manishshrivastava.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/manishshrivastava.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/manishshrivastava.com\/blog\/wp-json\/wp\/v2\/comments?post=72"}],"version-history":[{"count":10,"href":"https:\/\/manishshrivastava.com\/blog\/wp-json\/wp\/v2\/posts\/72\/revisions"}],"predecessor-version":[{"id":85,"href":"https:\/\/manishshrivastava.com\/blog\/wp-json\/wp\/v2\/posts\/72\/revisions\/85"}],"wp:attachment":[{"href":"https:\/\/manishshrivastava.com\/blog\/wp-json\/wp\/v2\/media?parent=72"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/manishshrivastava.com\/blog\/wp-json\/wp\/v2\/categories?post=72"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/manishshrivastava.com\/blog\/wp-json\/wp\/v2\/tags?post=72"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}