I’m building a web interface to a few tools and I’d like to be able to run commands or gems within a Bundler context, like the ‘bundle exec’ command does, except from within my code.
So usually, I’d write on the command line:
bundle exec rspec
Is there a way I can achieve the same thing, but programatically?
If you want to run some ruby with bundled gems you can just require “bundler/setup”: