I was running into an issue with bundler when using rbenv. I had switched from ruby 2.3.1 to 2.5.1 a while ago, but I noticed the following error when trying to run bundler inside of a shell script in an ansible task.
``` rbenv: bundle: command not found
The `bundle' command exists in these Ruby versions:
2.2.2
2.3.1
```
I saw some solutions to this where you had to install bundler when on a specific ruby version. However even uninstalling bundler and reinstalling it did not resolve the issue. It seemed due to some gem issue that I could not install bundler on specific ruby versions, thus reinstalling bundler did nothing for me.