I had a similar experience. I would have simply ran the code below to fix it temporarily
bundle install --path vendor/bundle
The downside to this is that it does not solve the issue permanently, as the issue will re-surface when you start out with other Ruby on Rails Applications.
I tried this solution, but it did not work for me:
Display a list of all your local gems for the bundler gem
gem list bundler
N/B: The command above is for rbenv version manager, the one for rvm might be different
This will display the versions of the bundler gem installed locally
bundler (2.0.2, default: 1.17.3, 1.10.6)
And then ran the code below below to uninstall version 1.10.6
gem uninstall bundler
Afterwhich I ran the code below to rehash rbenv
rbenv rehash
However, this did not solve the issue.
Here's how I solved it;
The issue was that I mistakenly ran a bundle install
operation with administrative rights, that is:
sudo bundle install
which made the owner of the ~/.rbenv
OR ~/.rvm
directory to become root
To solve the issue I ran the code below to change the ownership of the files and directories.
For rbenv users:
sudo chown -R $USER ~/.rbenv
And for RVM users
sudo chown -R $USER ~/.rvm
That's it.
I hope this helps