Install ruby 2.7.3 on Mac M1 issue

1.6k Views Asked by At

When I try to install the ruby 2.7.3 version on mac m1 it installs, it shows in my machine also but when I try sudo bin/setup_dev this command its show me error like

Bundling rails dependencies Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on
this machine. Your Ruby version is 2.6.3, but your Gemfile specified ~> 2.7.3
bin/setup_dev: 
Failed to run 'bundle install > log/setup_dev.log', check log/setup_dev.log for more information.
aim@aim-MacBook-Air openproject % rbenv global 2.7.3
aim@aim-MacBook-Air openproject % ruby -v                                         
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]

please any one can help to install ruby v 2.7.3 on mac. Things that I try

Install ruby using rosetta 2

I am new on ruby please help on this. thanks in advance.

1

There are 1 best solutions below

0
On

Specifying a ruby version in a bundler gemfile doesn’t magically install that version of ruby. You need to start by learning to use a ruby version management system. I recommend Homebrew and rbenv.

(And not just in order to get a different ruby version. Always install your own ruby. Never use the built in system ruby for anything! If you have to say sudo you’re doing it wrong.)