title: Execute system command with Rake outside Bundle scope
body: <p>Let say I have this Rake task: </p>
  
  <pre><code>namespace :db do
    namespace :dump do.
      desc 'Backup database dump to s3'
      task :backup =&gt; :environment do 
        cmd = ['backup', 'perform',  '-t project_backup',  "-c #{Rails.root.join 'lib', 'backup', 'config.rb'}"] 
        system(*cmd)                      # ...I've tried `` &amp; exec() sa well, same thing
      end
    end
  end
  </code></pre>
  
  <p>Backup gem is stand alone ruby gem application which dependencies needs to be isolated from application bundler. In other words it cannot be part of <code>Gemfile</code>. This gem is simply installed over <code>gem install backup</code></p>
  
  <p>When I run <code>backup</code> command over bash console, it successfully run:</p>
  
  <pre><code>$ backup perform -t validations_backup -c /home/equivalent/my_project/lib/backup/config.rb
  </code></pre>
  
  <p>When I execute <code>rake db:dump:backup</code> I will get </p>
  
  <pre><code>backup is not part of the bundle. Add it to Gemfile. (Gem::LoadError)
  </code></pre>
  
  <p>...which is the same thing when I run backup command with <code>bundle exec</code> from bash</p>
  
  <pre><code>$ bundle exec backup perform -t validations_backup -c /home/equivalent/my_project/lib/backup/config.rb
  </code></pre>
  
  <p>...meaning that the <code>backup</code> command is executed over bundler when run as part of rake task.</p>
  
  <p><strong>my question:</strong> How can I run <code>rake db:dump:backup</code> outsite the bundle scope, meaning that <code>backup</code> command won`t be executed over bundler?</p>
  
  <p>Thank you</p>