title: Rails: Gem that runs bundle install and a list of commands
body: <p>I'm creating a gem that runs some commands inside a folder.</p>
  
  <p>List of commands:</p>
  
  <pre><code>bundle install
  bundle exec rake db:migrate db:seed
  </code></pre>
  
  <p>Commands are un using</p>
  
  <pre><code>Dir.chdir folder_name
  stdout, stderr, status = Open3.capture3 command
  </code></pre>
  
  <p>The problem is that the bundle install is run inside the gem and not inside the folder. And running the rake commands returns an error: rails not found because bundle is not run inside the folder.</p>
  
  <p>Any idea?</p>