Sinatra 应用程序在本地运行但在 Heroku 上出现内部服务器错误
Sinatra App Works Locally but Internal Server Error on Heroku
导致问题的相关代码在我看来似乎是这样的:
<input type="checkbox" id=<%= "#{a[0]}#{ndx}" -%> class="toggle" />
<label for=<%= "#{a[0]}#{ndx}" -%> class="popup-label">
这会在 Heroku 日志中引发以下错误:
SyntaxError - /app/views/index.erb:25: syntax error, unexpected ')'
2017-03-17T06:30:26.877056+00:00 app[web.1]: ...buf.concat(( "#{a[0]}#{ndx}" -).to_s); @_out_buf.concat " cl...
2017-03-17T06:30:26.877061+00:00 app[web.1]: /app/views/index.erb:26: syntax error, unexpected ')'
2017-03-17T06:30:26.877057+00:00 app[web.1]: ... ^
2017-03-17T06:30:26.877061+00:00 app[web.1]: ...buf.concat(( "#{a[0]}#{ndx}" -).to_s); @_out_buf.concat " cl...
我最初认为这可能是使用WEBrick 和Puma 之间的区别,但我交换了它们并没有发现任何区别。建议?
请尝试以下
<input type="checkbox" id="<%= a[0].to_s + ndx.to_s %>" class="toggle" />
<label for="<%= a[0].to_s + ndx.to_s %>" class="popup-label">
导致问题的相关代码在我看来似乎是这样的:
<input type="checkbox" id=<%= "#{a[0]}#{ndx}" -%> class="toggle" />
<label for=<%= "#{a[0]}#{ndx}" -%> class="popup-label">
这会在 Heroku 日志中引发以下错误:
SyntaxError - /app/views/index.erb:25: syntax error, unexpected ')'
2017-03-17T06:30:26.877056+00:00 app[web.1]: ...buf.concat(( "#{a[0]}#{ndx}" -).to_s); @_out_buf.concat " cl...
2017-03-17T06:30:26.877061+00:00 app[web.1]: /app/views/index.erb:26: syntax error, unexpected ')'
2017-03-17T06:30:26.877057+00:00 app[web.1]: ... ^
2017-03-17T06:30:26.877061+00:00 app[web.1]: ...buf.concat(( "#{a[0]}#{ndx}" -).to_s); @_out_buf.concat " cl...
我最初认为这可能是使用WEBrick 和Puma 之间的区别,但我交换了它们并没有发现任何区别。建议?
请尝试以下
<input type="checkbox" id="<%= a[0].to_s + ndx.to_s %>" class="toggle" />
<label for="<%= a[0].to_s + ndx.to_s %>" class="popup-label">