middleman / middleman-livereload

LiveReload support for Middleman
http://middlemanapp.com
MIT License
117 stars 39 forks source link

Middleman eventmachine issue on Windows 7-64? #33

Closed karland closed 10 years ago

karland commented 11 years ago

Hi, I have a problem running middleman-livereload on Windows 7-64bit with

d:\myWebsites\Middleman_test>ruby -v
ruby 2.0.0p247 (2013-06-27) [x64-mingw32]

My gemfile looks like

# If you have OpenSSL installed, we recommend updating
# the following line to use "https"
source 'http://rubygems.org'

gem "middleman", "~>3.1.3"

# Live-reloading plugin
gem "middleman-livereload", "~> 3.1.0"

# For faster file watcher updates: # Windows
gem "wdm", "~> 0.1.0"  # Windows

# Cross-templating language block fix for Ruby 1.8
platforms :mri_18 do
  gem "ruby18_source_location"
end

It installs perfectly:

d:\myWebsites\Middleman_test>bundle install
Fetching gem metadata from http://rubygems.org/........
Fetching gem metadata from http://rubygems.org/..
Resolving dependencies...
Using i18n (0.6.4)
Using multi_json (1.7.7)
Using activesupport (3.2.12)
Using bundler (1.3.5)
Using chunky_png (1.2.8)
Using coffee-script-source (1.6.3)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using fssm (0.2.10)
Using sass (3.2.9)
Using compass (0.12.2)
Using em-websocket (0.5.0)
Using tilt (1.3.7)
Using haml (4.0.3)
Using hike (1.2.3)
Using kramdown (1.0.2)
Using rb-fsevent (0.9.3)
Using rb-inotify (0.9.0)
Using rb-kqueue (0.2.0)
Using listen (1.2.2)
Using rack (1.5.2)
Using rack-test (0.6.2)
Using thor (0.18.1)
Using middleman-core (3.1.3)
Using middleman-more (3.1.3)
Using sprockets (2.10.0)
Using sprockets-helpers (1.0.1)
Using sprockets-sass (1.0.1)
Using middleman-sprockets (3.1.2)
Using uglifier (2.1.2)
Using middleman (3.1.3)
Using rack-livereload (0.3.15)
Using middleman-livereload (3.1.0)
Using wdm (0.1.0)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

With

# Reload the browser automatically whenever files change
# activate :livereload

the

bundle exec middleman server 

runs perfectly. However, with

# Reload the browser automatically whenever files change
activate :livereload

suddenly, I get the following errors:

C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/em-websocket-0.5.0/lib/em-websocket.rb:3:in `require': cannot   load such file -- eventmachine (LoadError)
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/em-websocket-0.5.0/lib/em-websocket.rb:3:in `<top (required)>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/middleman-livereload-3.1.0/lib/middleman-livereload/reactor.rb:1:in `require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/middleman-livereload-3.1.0/lib/middleman-livereload/reactor.rb:1:in `<top (required)>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/middleman-livereload-3.1.0/lib/middleman-livereload/extension_3_1.rb:2:in `require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/middleman-livereload-3.1.0/lib/middleman-livereload/extension_3_1.rb:2:in `<top (required)>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/middleman-livereload-3.1.0/lib/middleman-livereload.rb:6:in `require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/middleman-livereload-3.1.0/lib/middleman-livereload.rb:6:in `block in <top (required)>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/middleman-core-3.1.3/lib/middleman-core/extensions.rb:46:in `call'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/middleman-core-3.1.3/lib/middleman-core/extensions.rb:46:in `load'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/middleman-core-3.1.3/lib/middleman-core/core_extensions/extensions.rb:103:in `activate'
from d:/myWebsites/Middleman_test/config.rb:39:in `initialize'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/middleman-core-3.1.3/lib/middleman-core/core_extensions/extensions.rb:162:in `instance_eval'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/middleman-core-3.1.3/lib/middleman-core/core_extensions/extensions.rb:162:in `initialize'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/middleman-core-3.1.3/lib/middleman-core/core_extensions/data.rb:35:in `initialize'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/middleman-core-3.1.3/lib/middleman-core/application.rb:169:in `initialize'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/middleman-core-3.1.3/lib/middleman-core/core_extensions/request.rb:49:in `new'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/middleman-core-3.1.3/lib/middleman-core/core_extensions/request.rb:49:in `inst'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/middleman-core-3.1.3/lib/middleman-core/preview_server.rb:89:in `new_app'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/middleman-core-3.1.3/lib/middleman-core/preview_server.rb:171:in `mount_instance'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/middleman-core-3.1.3/lib/middleman-core/preview_server.rb:20:in `start'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/middleman-core-3.1.3/lib/middleman-core/cli/server.rb:73:in `server'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor.rb:363:in `dispatch'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/middleman-core-3.1.3/lib/middleman-core/cli.rb:77:in `method_missing'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/command.rb:29:in `run'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/command.rb:128:in `run'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor.rb:363:in `dispatch'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/middleman-core-3.1.3/lib/middleman-core/cli.rb:22:in `start'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/middleman-core-3.1.3/bin/middleman:18:in `<top (required)>'
from C:/Ruby200-x64/bin/middleman:23:in `load'
from C:/Ruby200-x64/bin/middleman:23:in `<main>'

Can you help?
Also, but I am not sure if it's relevant

middleman init --help

produces

WARN: Unresolved specs during Gem::Specification.reset:
      activesupport (~> 3.2.6)
      i18n (~> 0.6.1)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.

Thanks a lot!

karland commented 11 years ago

Coming back to my previous mail. I re-installed

ruby 1.9.3p448 (2013-06-27) [i386-mingw32]

And the above error disappears. Livereload with middleman is working, the only thing is the browsers do not refresh under Windows 7, neither Firefox nor Chrome. If I go under development tools | network I see activities named livereload, but no impact on the screens. Thanks!

karland commented 11 years ago

Sorry, need to re-open. Wrong button....

athanph commented 11 years ago

I'm having the same problem. LiveReload doesn't reload pages. Using MM 3.1.4 and LR 3.1.0

On

<script type="text/javascript">
    WEB_SOCKET_SWF_LOCATION = "/__rack/WebSocketMain.swf";
</script>
<script type="text/javascript" src="/__rack/swfobject.js"></script>
<script type="text/javascript" src="/__rack/web_socket.js"></script>
<script type="text/javascript">
  RACK_LIVERELOAD_PORT = 35729;
</script>
<script type="text/javascript" src="/__rack/livereload.js?host=//0.0.0.0&amp;port=35729"></script>
karland commented 10 years ago

I am not sure what has changed, but in the meantime middleman-livereload is working smoothly under Windows 7 with ruby 1.93.p484 (2013-11-22) [i386-mingw32]. So I consider this issue closed. Thanks.