A blog about the problems I've encountered while being a Ruby on Rails developer, and how I've solved them.
Thursday, March 5, 2015
Using Bundler in a Rake Task
If you want to use Bundler in a rake task to automate something like bundle install, you can't simply call bundle install in a system call. Fortunately, Bundler provides a method called Bundler.with_clean_env. Using that, you can do something like
system 'bundle install'