Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Upgrade Rails 101 Workshop at Philly.rb

Upgrade Rails 101 Workshop at Philly.rb

A workshop to upgrade your Ruby on Rails application. Presented at Philly.rb (April, 2019)

Ernesto Tagwerker

April 16, 2019
Tweet

More Decks by Ernesto Tagwerker

Other Decks in Programming

Transcript

  1. 39 $ bundle outdated Fetching gem metadata from https://rubygems.org/. Resolving

    dependencies..... Outdated gems included in the bundle: * actioncable (newest 5.2.3, installed 5.1.6) * actionmailer (newest 5.2.3, installed 5.1.6) * actionpack (newest 5.2.3, installed 5.1.6) * actionview (newest 5.2.3, installed 5.1.6) ...
  2. 42 $ bundle_report outdated redcarpet 3.0.0: released over 5 years

    ago (latest version, 3.4.0, released over 2 years ago) bootstrap-sass 3.3.7: released over 2 years ago (latest version 3.4.1, released about 2 months ago) ... mail 2.7.0: released over 1 year ago (latest version, 2.7.1, released 6 months ago) activesupport 5.1.6: released about 1 year ago (latest version, 5.2.3, released 11 days ago) railties 5.1.6: released about 1 year ago (latest version, 5.2. released 11 days ago) 0 gems are sourced from git 65 of the 102 gems are out-of-date (64%)
  3. 44 $ bundle_report compatibility --rails-version=6.0.0.beta3 => Incompatible with Rails 6.0.0.beta3

    (with new versions that are compatible): These gems will need to be upgraded before upgrading to Rails 6.0.0.beta3. rails-controller-testing 1.0.2 - upgrade to 1.0.4 responders 2.4.0 - upgrade to 2.4.1 2 gems incompatible with Rails 6.0.0.beta3 (this is for an app running Rails 5.1.4)
  4. 45 # spec/rails_helper.rb require 'deprecation_tracker' RSpec.configure do |config| if ENV["DEPRECATION_TRACKER"]

    DeprecationTracker.track_rspec( config, shitlist_path: "spec/support/deprecation_warning.shitlist.json", mode: ENV["DEPRECATION_TRACKER"], transform_message: -> (message) { message.gsub("#{Rails.root}/", "") } ) end # ...
  5. ... ✅ 2.3 3.0 ✅ 3.0 3.1 ✅ 3.1 3.2

    ✅ 3.2 4.0 ✅ 4.0 4.1 ✅ 4.1 4.2 ✅ 4.2 5.0 ✅ 5.0 5.1 ✅ 5.1 5.2 ✅ 5.2 6.0 51 Gemfile Gemfile.next { }
  6. 57 $ next --init Created Gemfile.next (a symlink to your

    Gemfile). Your Gemfile has been modified to support dual-booting! There's just one more step: modify your Gemfile to use a newer version of Rails using the `next?` helper method. For example, here's how to go from 5.2.3 to 6.0: if next? gem "rails", "6.0.0" else gem "rails", "5.2.3" end
  7. 58 # Gemfile def next? File.basename(__FILE__) == "Gemfile.next" end source

    'https://rubygems.org' gem 'rails', '~> 5.1.1’
  8. 62 $ BUNDLE_GEMFILE=Gemfile.next bundle install Bundler could not find compatible

    versions for gem "activesupport": In snapshot (Gemfile.lock): activesupport (= 4.2.1) In Gemfile: activeadmin was resolved to 1.0.0.pre4, which depends on arbre (>= 1.0.2, ~> 1.0) was resolved to 1.1.1, which depends on activesupport (>= 3.0.0) activeadmin was resolved to 1.0.0.pre4, which depends on inherited_resources (~> 1.6) was resolved to 1.7.0, which depends on ...
  9. 64 $ BUNDLE_GEMFILE=Gemfile.next bundle exec rake rake aborted! Bundler::GemRequireError: There

    was an error while trying to load the gem 'test_after_commit'. Gem Load Error is: after_commit testing is baked into rails 5, you no longer need test_after_commit gem Backtrace for gem load error is: /Users/etagwerker/.rvm/gems/ruby-2.4.5@petitions/gems/ test_after_commit-1.1.0/lib/test_after_commit.rb:4:in `<top (required)>' /Users/etagwerker/.rvm/rubies/ruby-2.4.5/lib/ruby/site_ruby/2.4.0/ bundler/runtime.rb:81:in `require' /Users/etagwerker/.rvm/rubies/ruby-2.4.5/lib/ruby/site_ruby/2.4.0/ bundler/runtime.rb:81:in `block (2 levels) in require' /Users/etagwerker/.rvm/rubies/ruby-2.4.5/lib/ruby/site_ruby/2.4.0/ bundler/runtime.rb:76:in `each'
  10. 65 # Gemfile # ... group :test do gem 'nokogiri'

    gem 'shoulda-matchers' gem 'pickle' gem 'test_after_commit' unless next? end
  11. 66 $ BUNDLE_GEMFILE=Gemfile.next bundle exec rake NoMethodError: undefined method `hide_action'

    for Delayed::Web::ApplicationController:Class # ./config/initializers/delayed_web.rb:10:in `block in <top (required)>' # ./config/initializers/delayed_web.rb:7:in `class_eval' # ./config/initializers/delayed_web.rb:7:in `<top (required)>' # /Users/etagwerker/.rvm/gems/ruby-2.4.5@petitions/gems/ activesupport-5.0.7.2/lib/active_support/dependencies.rb:287:in `load' # /Users/etagwerker/.rvm/gems/ruby-2.4.5@petitions/gems/ activesupport-5.0.7.2/lib/active_support/dependencies.rb:287:in `block in load' # /Users/etagwerker/.rvm/gems/ruby-2.4.5@petitions/gems/ activesupport-5.0.7.2/lib/active_support/dependencies.rb:259:in `load_dependency'
  12. 70 $ BUNDLE_GEMFILE=Gemfile.next bundle exec rake DEPRECATION WARNING: The success?

    predicate is deprecated and will be removed in Rails 6.0. Please use successful? as provided by Rack::Response::Helpers. (called from block (3 levels) in <top (required)> at /Users/etagwerker/Projects/ ombulabs/fastruby.io/spec/controllers/ contacts_controller_spec.rb:20) .DEPRECATION WARNING: The success? predicate is deprecated and will be removed in Rails 6.0. Please use successful? as provided by Rack::Response::Helpers. (called from block (4 levels) in <top (required)> at /Users/etagwerker/Projects/ ombulabs/fastruby.io/spec/controllers/ contacts_controller_spec.rb:32) ..DEPRECATION WARNING: The success? predicate is deprecated and will be removed in Rails 6.0. Please use successful? as provided by Rack::Response::Helpers. (called from block (4 levels) in <top (required)> at /Users/etagwerker/Projects/ ombulabs/fastruby.io/spec/controllers/ contacts_controller_spec.rb:52) ..........
  13. 79 # Gemfile source 'https://rubygems.org' git_source(:github) do |repo_name| repo_name =

    "#{repo_name}/#{repo_name}" unless repo_name.include?("/") "https://github.com/#{repo_name}.git" end if next? gem 'rails', github: 'rails/rails' else gem 'rails', '~> 6.0.0.beta3' end