title: net-ssh and remote environment
body: <p>I want to execute some remote command on my server using net-ssh library.</p>
  
  <p>I have the following example:</p>
  
  <pre><code>Net::SSH::start(host, user, options = {:keys =&gt; '~/.ssh/id_rsa'}) do |ssh|
    puts ssh.exec!("echo $PATH")
    ssh.loop
  end
  </code></pre>
  
  <p>The result is: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games</p>
  
  <p>My problem is that I have not my PATH loaded as it should be.</p>
  
  <p>I should also have some RVM paths, and custom paths defining into my .zshrc.</p>
  
  <p>How could I change this behavior to let net-ssh to use my .zshrc to load my default environment ?</p>
  
  <p><strong>Solution:</strong></p>
  
  <pre><code>puts ssh.exec!("source ~/.zshrc; echo $PATH")
  </code></pre>