Check your global bundler
You might want to delete the config if it points to a project as it should point to user installed bundler gems. Or maybe not exist. (I never actually use that config though as I have everything at the project level except bundle itself installed with
Check your project config for bundler
Delete it. It will be created using config step below.
The common flow is to always configure bundler for a new clone so you don’t install into user bundle gems but the project gems. Also the config should be in version control as its different for prod deploy
See commands below I used every time on mac or linux
git clone ...
bundle config --local path vendor/bundle
Then this install command will install to vendor in the project and it won’t ask for sudo
If you have a vendor directory already in your project you can delete it and the install command will create it fresh