benbjohnson / httpng

A local server for saving HTML elements as PNG files.
1 stars 0 forks source link

ERROR Errno::EISDIR #1

Closed DmitrySeredinov closed 12 years ago

DmitrySeredinov commented 12 years ago

Hi, Ben. As discussed in Twitter (@DmitrySeredinov), here is a stack trace for error that happens on:

MacOS X 10.7.3, ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]

Note that i've executed chmod for in/out dirs with 0777 recursive perms.

Hope this helps you to investigate the problem. Thanks in advance.

Trace:

[2012-05-17 20:24:52] ERROR Errno::EISDIR: Is a directory - /Users/dals/Sites/tw-bootstrap-mocks/
    /Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/file.rb:117:in `read'
    /Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/file.rb:117:in `each'
    /Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/file.rb:113:in `open'
    /Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/file.rb:113:in `each'
    /Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/handler/webrick.rb:71:in `service'
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
    /Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/handler/webrick.rb:13:in `run'
    /Library/Ruby/Gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:1295:in `run!'
    /Library/Ruby/Gems/1.8/gems/httpng-0.2.3/bin/httpng:62
    /usr/bin/httpng:19:in `load'
    /usr/bin/httpng:19
benbjohnson commented 12 years ago

What's the full text of what you're running on the command line? Also, do you receive the error when you start the httpng server or when you try to connect to it? It doesn't look like a Ruby 1.8 issue. It sounds like httpng is trying to access a directory as if it was a file for some reason.

DmitrySeredinov commented 12 years ago

I run httpng with trace like:

Mac-mini:tw-bootstrap-mocks dals$ httpng 
== httpng v0.2.3
[2012-05-18 11:26:31] INFO  WEBrick 1.3.1
[2012-05-18 11:26:31] INFO  ruby 1.8.7 (2010-01-10) [universal-darwin11.0]
== Sinatra/1.3.2 has taken the stage on 7020 for development with backup from WEBrick
[2012-05-18 11:26:31] INFO  WEBrick::HTTPServer#start: pid=58238 port=7020

After that 'httpng-output' directory appears in my 'tw-bootstrap-mocks' dir (as in README for htpng, correct behavior). And nothing happens: out dir is empty. The I try to point browser with URL: http://localhost:7020 After that console output looks like in original post of issue. Perhaps I've missed something when using httpng? Same traces && results happens when I specify another port && out dir for httpng. Thanks.

benbjohnson commented 12 years ago

I just took a look at this and I think I know the issue. It's poor communication on my part. When you run the server, you'll need to specify the HTML file that you want to view. So for example, if your file in your directory is called test.html, then go to http://localhost:7020/test.html instead of http://localhost:7020/. If you go to the root then it'll try to load the directory which won't work. I should add a directory listing to show available files.

DmitrySeredinov commented 12 years ago

Thanks to point that out. Now it running w/o error. :) There is another issue with html2canvas that i'll report now. Thanks.