title: Getting my Ruby file to load into Pry?
body: <p>I'm trying to edit my Ruby file with Pry. There are few variables that are set in it, and for whatever reason I can't seem to <code>cd</code> into them because they aren't being defined even after I 'load' the file.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>require 'nokogiri'
  require 'open-uri'
  
  doc = Nokogiri.XML('&lt;foo&gt;&lt;bar /&gt;&lt;foo&gt;', nil, 'UTF-8') 
  
  url = "http://superbook.eventmarketer.com/category/agencies/" 
  
  puts "Finished!"
  </code></pre>
  
  <p>In Pry I do:</p>
  
  <pre><code>load "./AgencyListingScraper.rb"
  </code></pre>
  
  <p>and then this is the output:</p>
  
  <pre><code>7] pry(main)&gt; load './AgencyListingScraper.rb'
  Finished!
  =&gt; true
  [8] pry(main)&gt; 
  </code></pre>
  
  <p>Then when I try to do something like:</p>
  
  <pre><code>[8] pry(main)&gt; url
  NameError: undefined local variable or method `url' for main:Object
  from (pry):6:in `__pry__'
  [9] pry(main)&gt; cd url
  Error: Bad object path: url. Failed trying to resolve: url. #&lt;NameError: undefined local     
  variable or method `url' for main:Object&gt;
  [10] pry(main)&gt; 
  </code></pre>
  
  <p>This is what I get.</p>
  
  <p>I think I'm not loading the file correctly although I've been searching for hours and I can't figure out how to properly do this. I was doing it right months ago when I had made a scraper with Ruby, but this time I'm having trouble just getting started because of this bit. </p>
  
  <p>Thanks for your help in advance!</p>