I tried to update the Ruby version of a Sinatra website I am working on to 2.1.3. When I tried to bundle I had some errors. Then I removed the Gemfile.lock and bundle install proceeded. But when I ran the website I noticed some thing like
NoMethodError at /auth/login
undefined method `join' for #<String:0x000000062d3830>
My observations are as below.
Ruby 2.1.2 with the old Gemfile.lock) workedyield_content(:head) tag.
yield_content tagsslim :index, :layout => :layout, :locals => body_localsWhat could be the error? I created a diff off the state of the Gemfile.lock before and after: https://gist.github.com/ziyan-junaideen/fb903abbdafdc2d4a02f
Error output from the terminal: https://gist.github.com/ziyan-junaideen/54bff4f05a5a7beeedff
I thought it was some SLIM error and downgraded Slim to 2.0.3 which used to be before the bundle install, but had no luck.
Any suggestion is highly appreciated.
Thanks
I have solved it by reinstalling slim and temple in versions slim: 2.0.3 and temple: 0.6.8, it's probably in temple, 'cos downgrading slim is not enough
I've got this error as well.
After some research I've found that it is happening because 'output buffer' for template rendering is an instance variable (its default name is @_out_buf), thus it is overwritten when each (sub)template rendering completes (because partials are being rendered in the same scope as main template)
There are a few ways to fix this without downgrading sinatra/slim/temple:
outvar value equals to _out_buf (local variable) @ lib/sinatra/base.rb#L814outvar option to slim method like this: == slim :sub_template, outvar: '_out_buf'I've also opened an issue at sinatra's repo at github: https://github.com/sinatra/sinatra/issues/939 (let's see what authors will say about this)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With