You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to run the provided example and it seems to be broken.
require 'sinatra'
require 'sinatra/handlebars'
class MyApp < Sinatra::Base
helpers Sinatra::Handlebars
get "/hello" do
handlebars :index, locals: {name: 'Joe'}
end
run! if app_file == $0
end
Gives me
RuntimeError - Template engine not found: handlebars:
/home/mtrovo/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:834:in `block in compile_template'
/home/mtrovo/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/tilt-1.4.1/lib/tilt.rb:127:in `fetch'
/home/mtrovo/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:832:in `compile_template'
/home/mtrovo/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:813:in `render'
/home/mtrovo/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/tilt-handlebars-1.3.1/lib/sinatra/handlebars.rb:4:in `handlebars'
hbs.rb:8:in `block in <class:MyApp>'
My gems versions are:
buftok (0.2.0)
bundler (1.3.5)
chronic_duration (0.10.6)
colorize (0.7.3)
diff-lcs (1.2.5)
em-twitter (0.3.3)
eventmachine (1.0.3)
handlebars (0.6.0)
handlebars-source (1.3.0)
http_parser.rb (0.6.0)
libv8 (3.16.14.7)
mockingbird (0.2.0)
numerizer (0.1.1)
rack (1.5.2)
rack-protection (1.5.3)
ref (1.0.5)
rspec (3.1.0)
rspec-core (3.1.5)
rspec-expectations (3.1.2)
rspec-mocks (3.1.2)
rspec-support (3.1.1)
simple_oauth (0.2.0)
sinatra (1.4.5)
therubyracer (0.12.1)
tilt (1.4.1)
tilt-handlebars (1.3.1)
The text was updated successfully, but these errors were encountered:
@commonsguy : Thanks. I've fixed this in the develop branch so you don't need to require tilt/handlebars explicitly. I plan to release a new Gem once I've fixed #5 (memory leak).
But in the meantime, @mtrovo you may use @commonsguy's suggestion and just add the following to the top of your app:
I'm trying to run the provided example and it seems to be broken.
Gives me
My gems versions are:
The text was updated successfully, but these errors were encountered: