Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLIM fails with Tilt 1.4.1 #218

Closed
rennhak opened this issue Nov 7, 2013 · 4 comments
Closed

SLIM fails with Tilt 1.4.1 #218

rennhak opened this issue Nov 7, 2013 · 4 comments

Comments

@rennhak
Copy link

rennhak commented Nov 7, 2013

When trying to render a SLIM file Tilt fails with

> [#BE4BE48B8D80] undefined method `set_output_charset' for #<Object:0xa417a1c>
> [#BE4BE48B8D80] 
> [#BE4BE48B8D80] src/views/about.slim:4:in `block in singleton class'
> [#BE4BE48B8D80] src/views/about.slim:131071:in `instance_eval'
> [#BE4BE48B8D80] src/views/about.slim:131071:in `singleton class'
> [#BE4BE48B8D80] src/views/about.slim:131069:in `__tilt_81563450'
> [#BE4BE48B8D80] /home/br/.rvm/gems/ruby-2.0.0-rc2@project/gems/tilt-1.4.1/lib/tilt/template.rb:170:in `call'
> [#BE4BE48B8D80] /home/br/.rvm/gems/ruby-2.0.0-rc2@project/gems/tilt-1.4.1/lib/tilt/template.rb:170:in `evaluate'
> [#BE4BE48B8D80] /home/br/.rvm/gems/ruby-2.0.0-rc2@project/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'

Got this while running guard-shell with

require 'slim'
require 'tilt'

# ...

template = Tilt.new( m[0] )
p template.render

% gem list | egrep -i "tilt|slim"
guard-slim (0.0.1)
html2slim (0.0.4)
slim (2.0.2)
tilt (1.4.1)

Any ideas?

@judofyr
Copy link
Collaborator

judofyr commented Nov 10, 2013

Where does "set_output_charset" come from?

@rennhak
Copy link
Author

rennhak commented Nov 14, 2013

Here is a more extended output in the issue I posted with guard-slim. I'm not sure where the problem is, hence the posting here and on guard-slim.

boof/guard-slim#2 (comment)

@judofyr
Copy link
Collaborator

judofyr commented Nov 30, 2013

This seems to be a problem with your template. You're calling the method "set_output_charset". Because you're not passing any scope to #render Tilt will instantiate a dummy Object. Obviously set_output_charset is not defined on that Object.

You either need to fix the template (maybe you meant SomeModule.set_output_charset) or pass the correct scope object to #render (template.render(obj) where obj implements the #set_output_charset method).

@judofyr
Copy link
Collaborator

judofyr commented Nov 30, 2013

I'm going to close this since it's been a while.

Just reopen it if it's still an issue.

@judofyr judofyr closed this as completed Nov 30, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants