maxwell / screencap

A gem to screencap webpages in ruby. Uses Phantom.js under the hood.
MIT License
179 stars 63 forks source link

uninitialized constant Screencap::Phantom::CGI #8

Closed davidpatters0n closed 10 years ago

davidpatters0n commented 10 years ago

Following your documentation: https://github.com/maxwell/screencap#usage

1.9.3-p392 :001 > require 'screencap'
 => true 
1.9.3-p392 :002 > 
1.9.3-p392 :003 >     f = Screencap::Fetcher.new('http://google.com')
 => #<Screencap::Fetcher:0x0000000182d128 @url="http://google.com"> 
1.9.3-p392 :004 >   screenshot = f.fetch
NameError: uninitialized constant Screencap::Phantom::CGI
    from /home/david/.rvm/gems/ruby-1.9.3-p392/gems/screencap-0.1.1/lib/screencap/phantom.rb:7:in `rasterize'
    from /home/david/.rvm/gems/ruby-1.9.3-p392/gems/screencap-0.1.1/lib/screencap/fetcher.rb:24:in `raster'
    from /home/david/.rvm/gems/ruby-1.9.3-p392/gems/screencap-0.1.1/lib/screencap/fetcher.rb:9:in `fetch'
    from (irb):4

Any particular reason why?

jamiew commented 10 years ago

This will fix it for you:

require 'cgi'

Didn't think that was ever a default? So should have never worked

davidpatters0n commented 10 years ago

@jamiew thank you for the quick response. That worked.

jamiew commented 10 years ago

submitted PR #9 to fix this globally

On Tue, Aug 5, 2014 at 9:16 AM, David Patterson notifications@github.com wrote:

Closed #8 https://github.com/maxwell/screencap/issues/8.

Reply to this email directly or view it on GitHub https://github.com/maxwell/screencap/issues/8#event-149235116.