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

Fixing connection/socket issues #150

Open
e2 opened this issue Oct 26, 2015 · 13 comments
Open

Fixing connection/socket issues #150

e2 opened this issue Oct 26, 2015 · 13 comments

Comments

@e2
Copy link
Contributor

e2 commented Oct 26, 2015

Hi everyone,

If you're having such problems, I created a branch that may "fix things".

Just put this in your Gemfile:

gem 'guard-livereload', github: 'guard/guard-livereload', ref: 'ac68bc1' # branch: misc_rework

and then use Bundler, e.g.

bundle exec guard -d

Details

Some currently reported bugs may be due to stuff happening "out of order" and "race conditions".

One thing fixed: guard-livereload may have not yet finished connecting before files were changed.

This means things may be a bit "slower" if you're not working over local connections (if connecting is slower) - but if your connection is slow, you want to know. (Rather than having random failures).

I hope this branch helps track such stuff down.

Please let me know if this branch makes a difference. I could just release it, but I want to make sure it has the right changes to help with future issues. And that it does actually help.

If you're still getting errors DO let me know - I'll add more debugs/changes to help track down and kill these pesky bugs...

@njt1982
Copy link

njt1982 commented Oct 28, 2015

Trying this now...

$ bundle install
Fetching git://github.com/guard/guard-livereload.git
Fetching gem metadata from https://rubygems.org/...........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Using chunky_png 1.3.4
Using coderay 1.1.0
Using multi_json 1.11.2
Using sass 3.4.18
Using compass-core 1.0.3
Using compass-import-once 1.0.5
Using rb-fsevent 0.9.6
Using ffi 1.9.10
Using rb-inotify 0.9.5
Using compass 1.0.3
Using eventmachine 1.0.8
Using http_parser.rb 0.6.0
Using em-websocket 0.5.1
Using formatador 0.2.5
Using listen 3.0.3
Using lumberjack 1.0.9
Using nenv 0.2.0
Using shellany 0.0.1
Using notiffany 0.0.8
Using method_source 0.8.2
Using slop 3.6.0
Using pry 0.10.3
Using thor 0.19.1
Using guard 2.13.0
Using guard-compass 1.1.0
Using guard-compat 1.2.1
Using guard-livereload 2.5.1 (was 2.5.0) from git://github.com/guard/guard-livereload.git (at 6362e9f)
Using guard-shell 0.7.1
Using bundler 1.7.3
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

@njt1982
Copy link

njt1982 commented Oct 28, 2015

Fatal error on load...

$ bundle exec guard -d
Using default guard file.

09:39:22 - ERROR - Invalid Guardfile, original error is:
> [#]
> [#] /Users/nthompson/.rvm/gems/ruby-1.9.3-p385@[REDACTED]/bundler/gems/guard-livereload-6362e9fb0500/lib/guard/livereload.rb:25: unknown type of %string
> [#]       %i(js_apple_webkit_extra_wait_ti...
> [#]          ^
> [#] /Users/nthompson/.rvm/gems/ruby-1.9.3-p385@[REDACTED]/bundler/gems/guard-livereload-6362e9fb0500/lib/guard/livereload.rb:25: syntax error, unexpected $end, expecting keyword_end
> [#]       %i(js_apple_webkit_extra_wait_ti...
> [#]          ^,
> [#] backtrace:
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.13.0/lib/guard/plugin_util.rb:105:in `require'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.13.0/lib/guard/plugin_util.rb:105:in `rescue in plugin_class'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.13.0/lib/guard/plugin_util.rb:97:in `plugin_class'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.13.0/lib/guard/plugin_util.rb:56:in `initialize_plugin'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.13.0/lib/guard/internals/plugins.rb:26:in `add'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.13.0/lib/guard/dsl.rb:185:in `block in guard'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.13.0/lib/guard/dsl.rb:182:in `each'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.13.0/lib/guard/dsl.rb:182:in `guard'
> [#]   (dsl)> ./Guardfile:36:in `block in evaluate'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.13.0/lib/guard/dsl.rb:141:in `group'
> [#]   (dsl)> ./Guardfile:9:in `evaluate'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.13.0/lib/guard/dsl.rb:377:in `instance_eval'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.13.0/lib/guard/dsl.rb:377:in `evaluate'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.13.0/lib/guard/guardfile/evaluator.rb:91:in `evaluate'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.13.0/lib/guard.rb:134:in `_evaluate'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.13.0/lib/guard.rb:49:in `setup'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.13.0/lib/guard/commander.rb:32:in `start'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.13.0/lib/guard/cli/environments/valid.rb:16:in `start_guard'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.13.0/lib/guard/cli.rb:122:in `start'
> [#]   (dsl)> $GEM_PATH[0]/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
> [#]   (dsl)> $GEM_PATH[0]/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
> [#]   (dsl)> $GEM_PATH[0]/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
> [#]   (dsl)> $GEM_PATH[0]/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.13.0/lib/guard/aruba_adapter.rb:32:in `execute'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.13.0/lib/guard/aruba_adapter.rb:19:in `execute!'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.13.0/bin/_guard-core:11:in `<main>'

@njt1982
Copy link

njt1982 commented Oct 28, 2015

This build also failed on your Jenkins CI - https://travis-ci.org/guard/guard-livereload/builds/87576582

@njt1982
Copy link

njt1982 commented Oct 28, 2015

It's complaining about this line: https://github.com/guard/guard-livereload/compare/misc_rework#diff-bec407288a23c17c3fa5f7f0e96b4e50R25

I dont know enough (or. indeed, anything) about Ruby to fix this.

@e2
Copy link
Contributor Author

e2 commented Oct 28, 2015

@njt1982 - you should migrate to Ruby 2.x (e.g. 2.2.3), because Ruby 1.9.3 is no longer officially supported.

@njt1982
Copy link

njt1982 commented Oct 28, 2015

Ok I'll look into switching... I haven't in the past because:
a) Everything I do at the moment for work still works with it ;)
b) Nothing has needed me to upgrade so far.

@jibiel
Copy link
Member

jibiel commented Oct 28, 2015

@e2 This worth a README mention. Is it possible to state gem version that will be usable with the old rubies?

@e2
Copy link
Contributor Author

e2 commented Oct 28, 2015

TL;DR - upgrading to latest versions immensely helps everyone in the long run

@njt1982, @jibiel - https://www.ruby-lang.org/en/news/2014/01/10/ruby-1-9-3-will-end-on-2015

So it it fails on Ruby 1.9.3, it's actually probably a good thing.

Currently, just by "supporting Ruby", we're supporting only Ruby 2.x anyway. I don't think we need to advertise that (until Ruby 3.x?). It probably doesn't make sense for every project out there to add a line to the README at this point.

I probably wouldn't mind accepting patches for Ruby 1.9.3 - though it isn't really fair to the Ruby core developer team and the Ruby community to be supporting old versions "just in case".

If someone REALLY needs 1.9.3 support for some strange reason, it shouldn't be hard to patch - and they'd be 100% responsible anyway.

It also isn't fair to us to have reports about problems with old versions of gems - because everyone is working hard to keep everything bug-free and "improving" all the time (which takes a lot of time by itself).

I'd rather have the cutting edge working perfectly - and immediately respond to newly created bugs and issues, than to "stay safe an keep things working as they are".

The latest released version should be working perfectly (and better than the rest). If not, that's what experimental and testing branches are for.

I'm not strict about this - just gently nudging the world in a better direction ;)

@jibiel
Copy link
Member

jibiel commented Oct 28, 2015

@e2 Understood. I'm always using the latest versions myself since it's a breeze with a plenty of version managers out there. So yeah, we should definitely encourage that.

I feel bad posting off-topic stuff in the issue tracker, so I've created Gitter room for the repo — https://gitter.im/guard/guard-livereload.

@njt1982
Copy link

njt1982 commented Oct 29, 2015

Ok I have switched to a newer Ruby version - turns out RVM was beint a PITA and version locking me to 1.9.3 even though Brew had installed 2.2.x....

$ bundle exec guard
Using default guard file.

15:49:10 - INFO - Guard::Compass is waiting to compile your stylesheets.
15:49:10 - INFO - LiveReload is waiting for a browser to connect.
15:49:10 - INFO - Guard is now watching at '/Users/nthompson/Sites/XXX/drupal/sites/all/themes/XXXX'
[1] guard(main)> 15:49:17 - INFO - New browser connecting...
15:49:17 - INFO - New browser connected (total: 1)
15:49:17 - INFO - New browser connecting...
15:49:17 - INFO - New browser connected (total: 2)

(some details redacted)

Lets see if this works better... Odd that there are 2 connectios. I conly clicked the Chrome plugin icon once.

@njt1982
Copy link

njt1982 commented Oct 29, 2015

This version is much more stable

@e2
Copy link
Contributor Author

e2 commented Oct 29, 2015

@njt1982 - I'm SO glad to hear that!

@kmiasko
Copy link

kmiasko commented Jun 11, 2016

That fix didn't worked for me either. I managed to make it work by adding host: '0.0.0.0' to Guardfile.

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

No branches or pull requests

4 participants