6

Trying to just get started building a site with Middleman, and I'm following the tutorial to a t, but when I start the server I always get "Unknown Extension: livereload"

I already have

group :development do
  gem 'middleman-livereload'
end

and

configure : development do
  activate :livereload
end

Any ideas?

Karim Tarek
  • 797
  • 4
  • 18
Colby CheeZe
  • 93
  • 1
  • 7
  • have you tried "bundle update" command in your project directory? – TSV Feb 16 '15 at 16:05
  • Tried it just now, doesn't seem to be the cause. Any other ideas? :( – Colby CheeZe Feb 17 '15 at 12:58
  • Have you added "gem 'middleman-livereload'" line to the "Gemfile" file? If the first snippet is from the Gemfile, may be try to remove ":development" condition for testing? – TSV Feb 17 '15 at 13:57
  • ROFL I guess that is what it was. I wonder why the group thing doesn't work. I'm still really new to this stuff, I've never had a problem doing that in rails, but obviously this is different. Perhaps the article I'm following on setting it up is outdated and that stuff doesn't work any more? – Colby CheeZe Feb 17 '15 at 14:55
  • May be :) I never used such a conditions. May by you should specify bundler options as described at the http://bundler.io/groups.html and http://yehudakatz.com/2010/05/09/the-how-and-why-of-bundler-groups/ ? – TSV Feb 17 '15 at 16:02
  • You can check also http://stackoverflow.com/questions/4118055/rails-bundler-doesnt-install-gems-inside-a-group – TSV Feb 17 '15 at 16:08

2 Answers2

5

I had the exact same problem. For some reason LiveReload isn't recognized when you include it in a group in your Gemfile. My fix:

gem 'middleman-livereload' # NOTE: breaks if placed inside a group!
group :middleman do
  gem 'middleman'
end

I'm using middleman 3.3.12 and middleman-livereload 3.4.2

Steve Benner
  • 1,679
  • 22
  • 26
0

I started with the blog flag out of the box.

middleman init MY_BLOG_PROJECT --template=blog

So, for me, the gem was never part of the original GEMFILE. My solution was to add the gem.

# Gemfile
gem 'middleman-livereload'

Ruby Static Sites FTW!

DaveWoodall.com
  • 727
  • 6
  • 22