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
Error on Ruby 1.9.3 #167
Comments
Hm, I'm not sure what might be the problem. Maybe the wrong version of Psych? |
Hi Ricardo, Thx for looking into this. I'm still on Ubuntu 12.10 which is Ruby 1.9.1 On Friday, 14 March 2014, Ricardo Mendes notifications@github.com wrote:
Create a nice day! Phone: +65 96673269 |
Hi. Same problem here, did you fix this issue?
|
In Ruby 1.9.3, the default YAML parser switched from Syck to Psych. Syck provides require 'yaml' doesn’t require the same module in Ruby <1.9 and Ruby >=1.9. From the docs:
Mustache takes care of this issue, as we can see in the code, but this was committed after the last release of the gem, which occurred 3 years ago. So the solution is to install it from source. Add the following to your Gemfile: gem 'mustache', :git => 'git://github.com/defunkt/mustache.git' Then use If you don’t use Bundler or want to install the gem globally, clone the repo and install the gem from it: git clone https://github.com/defunkt/mustache.git
cd mustache
gem build mustache.gemspec
gem install ./mustache-0.99.5.gem |
Install from sources worked for me 👍 |
Thank you for the insightful post @bfontaine. I'm closing this issue since it appears to be fixed in master, and continue work on the |
Installed it from source, updated Ruby, didn't work:
and the error is: /home/stw/.rvm/gems/ruby-2.1.1/gems/mustache-0.99.5/bin/mustache:78:in `read': no implicit conversion of nil into String (TypeError) from /home/stw/.rvm/gems/ruby-2.1.1/gems/mustache-0.99.5/bin/mustache:78:in `process_files' from /home/stw/.rvm/gems/ruby-2.1.1/gems/mustache-0.99.5/bin/mustache:109:in `' from /home/stw/.rvm/gems/ruby-2.1.1/bin/mustache:23:in `load' from /home/stw/.rvm/gems/ruby-2.1.1/bin/mustache:23:in `' from /home/stw/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval' from /home/stw/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `' so something is still amiss |
@Stwissel |
Ok - sorry. Forgot to mention what I did:
|
@Stwissel can you give it another go? |
Just (30 min ago) pulled from github and reinstalled mustache: stw@ubuntu:~/tests$ ruby --version ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] stw@ubuntu:~/tests$ cat test.mustache | mustache /usr/lib/ruby/1.9.1/psych.rb:206:in `parse': (): mapping values are not allowed in this context at line 3 column 6 (Psych::SyntaxError) from /usr/lib/ruby/1.9.1/psych.rb:206:in `parse_stream' from /usr/lib/ruby/1.9.1/psych.rb:289:in `load_stream' from /var/lib/gems/1.9.1/gems/mustache-0.99.5/bin/mustache:82:in `process_files' from /var/lib/gems/1.9.1/gems/mustache-0.99.5/bin/mustache:111:in `' from /usr/local/bin/mustache:23:in `load' from /usr/local/bin/mustache:23:in `' and on newer ruby: stw@ubuntu:~/tests$ ruby --version ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-linux] stw@ubuntu:~/tests$ cat test.mustache | mustache /home/stw/.rvm/gems/ruby-2.1.1/gems/mustache-0.99.5/bin/mustache:78:in `read': no implicit conversion of nil into String (TypeError) from /home/stw/.rvm/gems/ruby-2.1.1/gems/mustache-0.99.5/bin/mustache:78:in `process_files' from /home/stw/.rvm/gems/ruby-2.1.1/gems/mustache-0.99.5/bin/mustache:109:in `' from /home/stw/.rvm/gems/ruby-2.1.1/bin/mustache:23:in `load' from /home/stw/.rvm/gems/ruby-2.1.1/bin/mustache:23:in `' from /home/stw/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval' from /home/stw/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `' |
Upps... sorry - last test was wrong. Forgot to reinstall the gem in Ruby 2.1.1. Works like a charm now. So - fixed. You just need to specify in the upcoming gem definition that you need ruby 2.x |
Just FYI, issue is present on Ubuntu 14.04 if you Thanks! |
I just did apt-get install mustache and it worked On Friday, 12 September 2014, Konstantine Rybnikov notifications@github.com
Create a nice day! Phone: +65 96673269 |
@Stwissel just tried on my own Ubuntu 14.04 (previously tried on server), same error:
|
@Stwissel reproduced inside fresh docker image http://paste.ubuntu.com/8326823/ |
That paste is a bit confusing, is the system ruby |
@locks what's confusing? It should be reproduceable on any linux with docker installed and ~/tmp/tpl.yaml and ~/tmp/tpl.mustache preserved. You can omit Maybe this is more clear:
You can see ruby version also. |
@k-bx I'm not familiar with Ubuntu/etc, but I just tried installing $ mustache -v
Mustache v0.99.4 Maybe updating the |
@locks anyway, if someone is having similar issues, I wouldn't bother and just use something else (it's all mustache!), for example there's |
@locks (but just if you're very curious -- yes, I can confirm that on my non-vm ubuntu I have same output for |
|
That sounds like a good work around :] Hurray for interchangeable implementations! |
Installed mustache using
Executing:
I get the error:
For the combined file
Ruby:
What do I miss?
The text was updated successfully, but these errors were encountered: