Closed wanderingcrow closed 10 years ago
In lib/middleman-blog-editor/extension_3_1.rb replacing
52 if @mm.blog.path_matcher.match(url.sub(/^\//, ''))
with
52 matcher = @mm.blog.respond_to?(:path_matcher) ? @mm.blog.path_matcher.match(url.sub(/^\//, '')) : @mm.blog.source_template.extract(url.sub(/^\//, ''))
53 if matcher
will work.
That did it, thanks much!
Let's keep this open if we're got bad code in the extension.
Yeah, its better to fix it properly than a work around like above. For more information, here is the middle-man blog commit that broke this.
https://github.com/middleman/middleman-blog/commit/7e606bfa76699356c4210fd7881453b8de5895b7
Okay, getting an updated version out to fix this today!
Hello,
I'm still getting this issue (running latest middleman-blog-editor). I do not have a lib
directory to make the suggested edit above. I have the blog editor installed as a gem.
Any ideas how I can get this fixed?
Do you have the latest version of the gem? v0.4.1
? Check your Gemfile and run bundle update
to make sure.
@nayefc If that doesn't work, let me know, and I'll push out an updated gem.
I think this may have been the issue (although I'm pretty sure I always had v0.4.1
). It works now, thanks!
Hello,
I am getting the same error again. I haven't touched anything since then so I'm not sure what happened. When I uncomment activate :blog_editor
, I get the same error. It happens for all the website for any route. The error I get is:
NoMethodError at /blog
undefined method `path_matcher' for #<Middleman::Blog::BlogData:0x007fe69f13b888>
Ruby /Users/ncopty/.rvm/gems/ruby-2.0.0-p247/gems/middleman-blog-editor-0.4.1/lib/middleman-blog-editor/extension_3_1.rb: in call, line 52
Web GET localhost/blog
Running bundle install
shows the following versions installed:
Using middleman (3.2.2) Using middleman-blog (3.5.1) Using middleman-blog-editor (0.4.1)
Thank you,
@nayefc I think this is fixed by v0.5.0 which I haven't pushed out yet. I'll keep you updated.
Awesome, thanks! I'll be waiting.
Any updates on this? It's been a while since I was able to use this.
@nayefc v0.5.0
is up. Update your Gemfile
to use this new version and let me know.
Works, thanks!
This might just be my setup, but I'm getting the following error when I have the blog editor enabled in my config file:
NoMethodError: undefined method
path_matcher' for #<Middleman::Blog::BlogData:0x007fd3227ed388> /Users/pk/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/middleman-blog-editor-0.4.1/lib/middleman-blog-editor/extension_3_1.rb:52:in
call' /Users/pk/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/showexceptions.rb:24:incall' /Users/pk/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/head.rb:11:in
call' /Users/pk/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/lint.rb:49:in_call' /Users/pk/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/lint.rb:37:in
call' /Users/pk/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:138:incall' /Users/pk/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in
service' /Users/pk/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/webrick/httpserver.rb:138:inservice' /Users/pk/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/webrick/httpserver.rb:94:in
run' /Users/pk/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'I did some searching, but couldn't see what might be causing this. Any thoughts?
config file: https://gist.github.com/javaporter/7771316