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

rake preview shows a blank page in Safari 7 #1395

Closed
SteveLTN opened this Issue Oct 16, 2013 · 14 comments

Comments

Projects
None yet
@SteveLTN

SteveLTN commented Oct 16, 2013

Using Safari 7 on OS X Mavericks, when running rake preview and access localhost:4000 from Safari, it shows a blank page and showed in the console:

[Error] Failed to load resource: The network connection was lost. 
    http://localhost:4000/
[Error] Failed to load resource: The network connection was lost. (screen.css, line 0)
    http://localhost:4000/stylesheets/screen.css
[Error] Failed to load resource: The network connection was lost. (modernizr-2.0.js, line 0)
    http://localhost:4000/javascripts/modernizr-2.0.js
[Error] Failed to load resource: The network connection was lost. (octopress.js, line 0)
    http://localhost:4000/javascripts/octopress.js

Do a wget on the missing files:

❯ wget http://localhost:4000/javascripts/octopress.js                                                   ruby-1.9.3-p448
--2013-10-16 23:19:45--  http://localhost:4000/javascripts/octopress.js
Resolving localhost... 127.0.0.1, ::1, fe80::1
Connecting to localhost|127.0.0.1|:4000... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8502 (8.3K) [application/javascript]
Saving to: ‘octopress.js’

99% [=============================================================================> ] 8,482       --.-K/s   in 0s

2013-10-16 23:19:45 (81.7 MB/s) - Connection closed at byte 8482. Retrying.

--2013-10-16 23:19:46--  (try: 2)  http://localhost:4000/javascripts/octopress.js
Reusing existing connection to localhost:4000.
HTTP request sent, awaiting response... 416 Request Range Not Satisfiable

    The file is already fully retrieved; nothing to do.

which is not very normal.

It works fine on Chrome and Firefox.

@imathis

This comment has been minimized.

Owner

imathis commented Oct 17, 2013

I recently got this report from some folks on Twitter too. Thanks for creating the ticket. I've just installed Mavericks and I'll be taking a look. If you have any ideas, let me know. Thanks. :)

@SteveLTN

This comment has been minimized.

SteveLTN commented Oct 17, 2013

I have found that the file octopress.js should be 8482 bytes, but somehow the server reported 8502 bytes to the browser ( and wget too ), which leads the browser to think that the network connection is lost when received 8482 bytes.
Wget, Chrome and Firefox could probably automatically retry it, but Safari didn't somehow.
Thank you.

@parkr

This comment has been minimized.

Collaborator

parkr commented Nov 18, 2013

I've been using Mavericks for a couple weeks now and all is going well. Think we can close this?

@parkr parkr closed this Nov 18, 2013

@rvanmil

This comment has been minimized.

rvanmil commented Nov 18, 2013

I'm still having this issue. Only on Safari though; on Firefox and Chrome everything works just fine.

@dawnworld

This comment has been minimized.

dawnworld commented Nov 18, 2013

I have the same problem too. I use Chome instead when preview.

@chengyanlai

This comment has been minimized.

chengyanlai commented Nov 19, 2013

There is a solution that installing 'thin' (gem install thin) and adding it to the app's gem file.
I did the following to fix it

$ echo gem \"thin\" >> Gemfile
$ bundle install
@parkr

This comment has been minimized.

Collaborator

parkr commented Nov 19, 2013

I'd suggest using thin or a similar web server other than WEBrick. You may need to modify the preview task in the Rakefile to use the new executable.

@dawnworld

This comment has been minimized.

dawnworld commented Nov 19, 2013

@chengyanlai It's good, I solved it by using your method!

@rvanmil

This comment has been minimized.

rvanmil commented Nov 19, 2013

@chengyanlai @parkr Thanks, that's a good workaround.

theory added a commit to theory/theory.pm that referenced this issue Nov 26, 2013

Use thin for previews.
It works properly in Safari. See [Issue #1395](imathis/octopress#1395) for details.

theory added a commit to theory/theory.so that referenced this issue Nov 26, 2013

Use thin for previews.
It works properly in Safari. See [Issue #1395](imathis/octopress#1395) for details.
@monsterChen

This comment has been minimized.

monsterChen commented Dec 10, 2013

@chengyanlai Thanks!!! It work.

@harryhorn

This comment has been minimized.

harryhorn commented Dec 21, 2013

same. Adding thin to the Gemfile solved the issue. No need to change anything else just restart preview

@robahl

This comment has been minimized.

robahl commented Dec 22, 2013

So how to fix it without thin? I get an empty page on Safari 7 using both rackup and the preview. Firefox works just fine.

AlphaHydrae added a commit to AlphaHydrae/blog that referenced this issue Mar 5, 2014

@wesleysui

This comment has been minimized.

wesleysui commented Apr 10, 2014

@chengyanlai it works, thanks!

@NicholasTD07

This comment has been minimized.

NicholasTD07 commented Apr 21, 2014

@chengyanlai Thanks!

mchesler added a commit to mchesler/theladders.github.com that referenced this issue Jul 22, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment