title: Run a Ruby Script with Python
body: <p>I have a Ruby Script that when I run in the shell it works (as user):</p>
  <p><code>/home/user/wpscan/$ ruby ./wpscan.rb -u www.mysite.com</code></p>
  <p>However, I'd like to automate this with a function that I created with Python. Here is the python script:</p>
  <pre><code>#!/usr/bin/python
  
  import os
  wpscan_env = &quot;/wpscan/&quot;
  os.chdir(os.environ['HOME'] + wpscan_env)
  os.system(&quot;ruby ./wpscan.rb -u www.mysite.com&quot;)
  </code></pre>
  <p>Notice that the Python script is in a different folder, <code>home/user/python/first.py</code> and this is why I do the <code>os.chdir()</code> function. When I go back to the shell and type:</p>
  <p><code>/home/user/python/$ python first.py</code></p>
  <p>This is the output I get:</p>
  <blockquote>
  <p>Could not find addressable-2.4.0 in any of the sources</p>
  <p>Run `bundle install` to install missing gems.</p>
  </blockquote>
  <p>I am using Ubuntu 14.04 and in order to get wpscan to work, it asked me to install Ruby 2.3.0. I did this via RVM.</p>
  <p><code>wpscan.rb</code> has a few dependencies and it seems it's not instantiating them. Also if I'm inside the wpscan folder and do <code>ruby ./wpscan.rb ... </code> it will work. However if I try to do this from the home directory: <code>ruby wpscan/wpscan.rb ... </code> it throws an error:</p>
  <blockquote>
  <p>[ERROR] cannot load such file --typhoeus</p>
  <p>[TIP] try to run 'gem install typhoeus' or 'gem install --user-install typhoeus'. If you still get an error, Please see README file or <a href="https://github.com/wpscanteam/wpscan" rel="nofollow noreferrer">https://github.com/wpscanteam/wpscan</a></p>
  </blockquote>
  <p>I have no knowledge of Ruby, this is my first real Python script, and I just installed wpscan 2 nights ago. I'm way out of my league here and I need help. Any further question can be elaborated per request.</p>