skip to Main Content

I have created 2 React Native Project in my system but when i check the ruby version in both my project then both project have different ruby version one of is 2.7.5 and another is 2.7.6 .Ruby Version 2.7.5 works in one of my project without error. So how can i downgrade the ruby version 2.7.6 locally to 2.7.5 in my another project?

I’ve tried to uninstall the ruby from my project but it doesn’t work for me.

2

Answers


  1. Instead of downgrade the ruby version of your project my suggestion is to install multiple ruby version to your computer and select the correct ruby version for each project. You can install and manage multiple ruby version with tools like rbenv.

    Here is a link to check out:
    https://github.com/rbenv/rbenv

    Login or Signup to reply.
  2. Instead of downgrading the Ruby version of your project, you can set it dynamically.

    // Gemfile

    # Check the Ruby version.
    if RUBY_VERSION =~ /^2.7/
        # Use gems for Ruby 2.7
        ruby '2.7.5'
      else
        # Use gems for other Ruby versions
        ruby '2.7.6'
      end
    
      gem 'cocoapods', '~> 1.11', '>= 1.11.2'
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search