Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uninitialized constant Screencap::Phantom::CGI #12

Open
galetahub opened this issue Nov 3, 2014 · 3 comments
Open

uninitialized constant Screencap::Phantom::CGI #12

galetahub opened this issue Nov 3, 2014 · 3 comments

Comments

@galetahub
Copy link

screencap-0.1.1.gem
phantomjs-1.9.7.1.gem

require 'screencap'
f = Screencap::Fetcher.new('http://google.com')
screenshot = f.fetch
NameError: uninitialized constant Screencap::Phantom::CGI
    from /Volumes/Data/mario/.rvm/gems/ruby-2.0.0-p451/gems/screencap-0.1.1/lib/screencap/phantom.rb:7:in `rasterize'
    from /Volumes/Data/mario/.rvm/gems/ruby-2.0.0-p451/gems/screencap-0.1.1/lib/screencap/fetcher.rb:24:in `raster'
    from /Volumes/Data/mario/.rvm/gems/ruby-2.0.0-p451/gems/screencap-0.1.1/lib/screencap/fetcher.rb:9:in `fetch'
    from (irb):3
    from /Volumes/Data/mario/.rvm/rubies/ruby-2.0.0-p451/bin/irb:12:in `<main>'
@jamiew
Copy link
Collaborator

jamiew commented Nov 4, 2014

Huh, I thought I'd patched this a few months ago. Maybe not in the latest published gem?

@chrism
Copy link

chrism commented Nov 5, 2014

Hi, i'm getting a similar error with the same gem versions & code and also using the master branch of this repo as the gem source.

phantomjs 1.9.7.1
screencap 0.1.1
/usr/local/var/rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/screencap-0.1.1/lib/screencap/phantom.rb:7:in
`rasterize': uninitialized constant Screencap::Phantom::CGI (NameError)

@ssut
Copy link

ssut commented Nov 11, 2014

same environment, and same issue on here.

irb(main):001:0> require 'screencap'
=> true
irb(main):002:0> f = Screencap::Fetcher.new('https://ubit.info/ssut')
=> #<Screencap::Fetcher:0x007fa4518d8c70 @url="https://ubit.info/ssut">
irb(main):003:0> f.fetch(output: 'ssut.png', div: '#music_list')
NameError: uninitialized constant Screencap::Phantom::CGI
    from /Library/Ruby/Gems/2.0.0/gems/screencap-0.1.1/lib/screencap/phantom.rb:7:in `rasterize'
    from /Library/Ruby/Gems/2.0.0/gems/screencap-0.1.1/lib/screencap/fetcher.rb:24:in `raster'
    from /Library/Ruby/Gems/2.0.0/gems/screencap-0.1.1/lib/screencap/fetcher.rb:9:in `fetch'
    from (irb):3
    from /usr/bin/irb:12:in `<main>'

i have checked the issue #8 and now it works properly when i execute require 'cgi' before fetching.

ssut added a commit to ssut/screencap that referenced this issue Nov 15, 2014
ssut added a commit to ssut/screencap that referenced this issue Nov 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants