Created
September 27, 2022 02:50
-
-
Save simran-sawhney/a28fa6071b941a004c747e2d84f6edd6 to your computer and use it in GitHub Desktop.
Steps to upgrade to Ruby 3.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
STEP1: ruby 2.6 to 2.7 challenges | |
1. installed latest through rvm version | |
2. gem install bundler | |
3. just change puma version in gemfile to latest, it resolved | |
output: lots of warning errors coming from active record for **argument errors on running console or something | |
STEP2: after that updated the rails version to 6.0.4.4 (because rails 6.0.4 handled errors and warning from ruby 2.7) | |
update rails version in gemfile, and then run bundle update | |
it took a lot of time to update bundle | |
OUTPUT: on rails console, warning are gone. fetched user from console, worked cool | |
STEP3: try to up upgrade to ruby 3.0.0 | |
1. error raised as rvm couldnt find ruby, have to install latest stable rvm version => rvm get stable | |
2. rvm reload | |
3. rvm install ruby-3.0.0 | |
4. gem rspec-rubocop creating issue to require rainbow gem - /Users/simran/.rvm/gems/ruby-3.0.0/gems/activesupport-6.0.4.4/lib/active_support/dependencies.rb:324:in `require': cannot load such file -- rainbow (LoadError) | |
5. Rails param needs code change everywhere as rails param new version changed exception handling class name. https://github.com/nicolasblanco/rails_param/blob/master/UPGRADING.md | |
6. wherever ** arguments were expected and for example you have sent a hash foo({a: 1}), change it to rather foo(a: 1),, def foo (**args); end; | |
7. update .ruby-version file | |
8. update gemfile to mention correct ruby version 3.0.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment