middleman / middleman-livereload

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

Liveload broken: extension_3_1.rb:45:in `block in initialize': undefined local variable or method `files' #106

Closed soumyaray closed 3 years ago

soumyaray commented 4 years ago

Crossposting an issue from Middleman that they felt belonged over here: https://github.com/middleman/middleman/issues/2142

Getting this error when running middleman server:

~/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/middleman-livereload-3.4.6/lib/middleman-livereload/extension_3_1.rb:45:in `block in initialize': undefined local variable or method `files' for #<Middleman::LiveReloadExtension:0x007fa9e99e08a0> (NameError)
joapuiib commented 3 years ago

Seems it's already fixed, but not published yet.

I fixed this issue installing it from git.

In Gemfile:

gem 'middleman-livereload', git: 'https://github.com/middleman/middleman-livereload'
tdreyno commented 3 years ago

Thanks, I’ll push out a release if that’s the case.

joapuiib commented 3 years ago

I checked my local gem code. The problem seems to be the line 45, which is:

files.changed do |file|

The version on GitHub has: https://github.com/middleman/middleman-livereload/blob/master/lib/middleman-livereload/extension_3_1.rb#L48

app.files.changed do |file|

That looks like it has fixed it.

I encountered this error when upgrading to Middleman v5.

nogweii commented 3 years ago

LiveReload also has a small bug when reloading config.rb, which was resolved by #107 but that does not have a stable release yet.

@tdreyno a friendly ping/request for a new release.

tdreyno commented 3 years ago

Thanks for the bump. v3.4.7 released