mockko / livereload

LiveReload applies CSS/JS changes to Safari or Chrome w/o reloading the page (and autoreloads the page when HTML changes)
http://livereload.com/
1.18k stars 56 forks source link

Problems during connection with livereload server #1

Closed bitboxer closed 14 years ago

bitboxer commented 14 years ago

I can't connect with the livereload server. This message occurs:

LiveReload server connection closed. Please restart the server and re-enable LiveReload.

My Setup: Google Chrome 6.0.458.1 dev, Phusion Passenger (using Passenger Pane) under Mac Os X.

If you need more informations, I would love to help.

andreyvit commented 14 years ago

This is a known bug: when livereload attemps to monitor too many files (via a lame per-file watching API from EventMachine), it runs out of open file limit, throws an exception and disconnects the WebSocket.

Please try to increase ulimit -n from default 256 to something bigger:

ulimit -n 4096
livereload

I'm certainly rewriting the command-line tool to use something like fssm soon. Sorry for this issue.

bitboxer commented 14 years ago

With that setting it's working fine. You should update the documentation till you fix this :)

NV commented 14 years ago

LiveReload should use fsevent branch of directory_watcher on Mac OS X. It can handle much more files without blowing up CPU.

Updated: oops, I didn't notice, fssm also supports native FSEvents.

andreyvit commented 14 years ago

I'm on OS X myself, so yeah, I'm definitely going to use something with FSEvents.

…But thanks for the pointer to the branch, I may well prefer that to fssm.

grimen commented 14 years ago

FYI, the ulimit-thing worked for me as well. Awesome gem!

andreyvit commented 14 years ago

Quick q: does anyone here know a non-polling Ruby gem that supports directory watching on Windows?

christoph-buente commented 14 years ago

I tried on a pretty old and bloated project. Unfortunately the fix didn't work for me. Is there an error log or something?

christoph-buente commented 14 years ago

Tried again on a small project running phusion passenger 2.2.5 and Rails 2.3.5 locally (MacBook with snow leopard): Didn't work with or without the fix. I'd love to use livereload. Maybe you can build in a little debug option so i can give you a hand fixing it.

andreyvit commented 14 years ago

@christoph-buente Upcoming version 1.3 will have an option for debug output.

andreyvit commented 14 years ago

@christoph-buente A little debug option: -D. Please paste the console output here.

christoph-buente commented 14 years ago

$ livereload -D

Version: 1.3 (compatible with browser extension versions 1.3.x) Port: 10083 Watching: /Users/christoph/Projects/betterplace

andreyvit commented 14 years ago

@christoph-buente Does the ulimit workaround work for you?

millisami commented 14 years ago

For me too, the ulimit -n 4096 works. I'm on Mac OS X SnowLeo 10.6.4

christoph-buente commented 14 years ago

Nope, still the same error on a different file :)

christoph-buente commented 14 years ago

The project I'm trying to use with livereload has about 11000 files. I tried to exclude the directories vendor, script, tmp, doc, lib, config, features, spec but it's still too many files. But maybe it is a good idea to exclude these directories by default, or at least prepare a commented line in the .livereload file. Makes it easier for other rails users.

andreyvit commented 14 years ago

Nice idea about excluding Rails vendor/tmp/test stuff by default. (Config, I guess, should stay included? And doc — is there any html/js there? Do you generate it via rdoc?)

christoph-buente commented 14 years ago

config is just read once at startup time, except config/locales. And docs are mostly generated with a rake task. There is html in it. But how often does that change? Just when creating documentation and checking it. But a rake task has to be fired anyways.

andreyvit commented 14 years ago

@christoph-buente Are you sure routes.rb is not reloaded when changed? It's been a long while since I've developed anything in Rails, but I have an impression that it does.

christoph-buente commented 14 years ago

Yeah, you're right. There is possibly more that gets reloaded, depending on the project setup. But config/initializeres doesn't. But people would be adjusting it to their needs anyway. Just put a commented line in the .livereload config file. Developers should know what gets reloaded in development environment.

andreyvit commented 14 years ago

Version 1.4 released should fix ulimit problems for good. Please update and test.

bitboxer commented 14 years ago

Yes, working great. Awesome!

christoph-buente commented 14 years ago

Thx for the progress, good work! Install was fine, but there seems to be the ruby-cocoa binding missing. I use a custom installation of ruby-enterprise. Is there a way install the binding afterwards? I tried to install it with ports. But then ports tries to install ruby and the whole stack.

Version: 1.4 (compatible with browser extension versions 1.4.x) Port: 35729 Watching: /Users/christoph/Projects/betterplace

LiveReload is waiting for browser to connect. /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require': no such file to load -- osx/foundation (LoadError) from /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire' from /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/platform/mac/rubycocoa_watcher.rb:2

unixmonkey commented 14 years ago

I was getting the same thing, so I rm'd /Librarary/Frameworks/RubyCocoa.framework and went to http://rubycocoa.sourceforge.net/GettingStarted, got the source .tgz and ran the source install instructions on that page and all is right with the world. The .dmg binary release doesn't seem to install all the goodies that livereload needs to run properly.

christoph-buente commented 14 years ago

Thx for the quick reply. It worked fine, after reinstallation of ruby enterprise with the shared library flag. See here: http://www.rubyenterpriseedition.com/documentation.html#_rubycocoa_compatibility_and_tt_enable_shared_tt

Thx for the awesome piece of software. It makes the live of a webdeveloper so much easier!

scottmessinger commented 14 years ago

I tried reinstalling rubycocoa from the tgz and it still is giving me the error message about 'osx/foundation'