I have a Ruby script called foo.rb, and I want to run it within the context of the bundler environment. How?
bundle exec foo.rb doesn\'t work, because exec
bundle exec foo.rb
For instance, I wanted to use the same version of Rubocop as my Rails app and not the latest system one, so doing this in a script:
require 'bundler' Bundler.require # ...
Allowed me to use my app's version of rubocop.