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

Already on GitHub? Sign in to your account

Ruby 1.9.2 doesn't automatically include "." in the $LOAD_PATH. #100

Closed
unders opened this Issue Jun 26, 2011 · 6 comments

Comments

Projects
None yet
4 participants

unders commented Jun 26, 2011

Hi!

When I run Sinatra and Mustache under Ruby 1.9.2, requiring the view classes doesn't work. When
requiring a file relative to current directory it must be prefixed with "./".

Here is my fix:

Cheers

Owner

defunkt commented Jun 27, 2011

Is this the only part of Mustache that makes this assumption?

Contributor

josh commented Jun 27, 2011

Seems like template_path and view_path should be absolute paths, not logical load paths.

unders commented Jun 27, 2011

Yes, only when I require the view_path this occur. template_path is no problem since it is only read and not required.

Contributor

josh commented Jun 27, 2011

Relative requiring files is a smell to me. Actually, even absolute requires are nasty.

Seems like this should just be documented that the view path needs to be in your $:.

unders commented Jun 27, 2011

Sorry for not testing this before, but if you do this:

set :mustache, views: './views', templates: 'templates'

it works.

So maby just some documentation about how to set it up for Ruby 1.9.

Owner

locks commented Aug 7, 2014

Mustache will only support >= 1.9.3 coming up.

@locks locks closed this Aug 7, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment