rubyonjets / jets

Ruby on Jets
http://rubyonjets.com
MIT License
2.6k stars 181 forks source link

๐ŸŽ‰ emoji in default index.html causes enconding problem with default installation #59

Closed onnimonni closed 6 years ago

onnimonni commented 6 years ago

I get this error while starting the default project.

$ jets new project
$ cd project
$ jets version
1.0.9
$ jets server
127.0.0.1 - - [05/Nov/2018:17:36:34 +0000] "GET / HTTP/1.1" 500 183736 0.7434
^[[AI, [2018-11-05T17:38:33.230710 #578]  INFO -- : Processing by Jets::PublicController#show
I, [2018-11-05T17:38:33.232358 #578]  INFO -- :   Event: {"resource"=>"/", "path"=>"/", "httpMethod"=>"GET", "headers"=>{"Host"=>"localhost:8888", "User-Agent"=>"curl/7.52.1", "Accept"=>"*/*", "Version"=>"HTTP/1.1"}, "queryStringParameters"=>{}, "pathParameters"=>nil, "stageVariables"=>nil, "requestContext"=>{}, "body"=>nil, "isBase64Encoded"=>false}
I, [2018-11-05T17:38:33.232478 #578]  INFO -- :   Parameters: {}
ActionView::Template::Error: Your template was not saved as valid US-ASCII. Please either specify US-ASCII as the encoding for your template in your text editor, or mark the template with its encoding by inserting the following as the first line of the template:

# encoding: <name of correct encoding>.

The source of your template was:

<!DOCTYPE html>
<html>
<body>
  <div class="container">
    <header class="header">
      <img src="https://s3.amazonaws.com/jets-public/jets/images/jets.png" class="logo" alt="logo" />
      <h1 class="title">Welcome and congrats ๐ŸŽ‰<br /> Jets is running.</h1>
    </header>
    <div class="intro">
      <p>
        To get started:
      </p>
      <div class="code"><pre><code>
        $ jets generate scaffold Post title:string
        $ jets db:create db:migrate
        $ jets server
        $ open http://localhost:8888/posts
        $ jets help
      </code></pre></div>
      <p>More on info: <a href="http://rubyonjets.com">rubyonjets.com</a></p>
      <p>Also check out the <a href="http://rubyonjets.com/reference">Jets CLI reference</a>.</p>
    </div>
    <p class="version">
      <strong>Jets version:</strong> 1.0.9<br />
      <strong>Ruby version:</strong> 2.5.0
    </p>
  </div>
</body>
</html>

    /usr/local/bundle/gems/actionview-5.2.1/lib/action_view/template.rb:232:in `encode!'
    /usr/local/bundle/gems/actionview-5.2.1/lib/action_view/template.rb:282:in `compile'
    /usr/local/bundle/gems/actionview-5.2.1/lib/action_view/template.rb:259:in `block (2 levels) in compile!'
    /usr/local/bundle/gems/activesupport-5.2.1/lib/active_support/notifications.rb:170:in `instrument'
    /usr/local/bundle/gems/actionview-5.2.1/lib/action_view/template.rb:350:in `instrument'
    /usr/local/bundle/gems/actionview-5.2.1/lib/action_view/template.rb:258:in `block in compile!'
    /usr/local/bundle/gems/actionview-5.2.1/lib/action_view/template.rb:246:in `synchronize'
    /usr/local/bundle/gems/actionview-5.2.1/lib/action_view/template.rb:246:in `compile!'
    /usr/local/bundle/gems/actionview-5.2.1/lib/action_view/template.rb:158:in `block in render'
    /usr/local/bundle/gems/activesupport-5.2.1/lib/active_support/notifications.rb:170:in `instrument'
    /usr/local/bundle/gems/actionview-5.2.1/lib/action_view/template.rb:354:in `instrument_render_template'
    /usr/local/bundle/gems/actionview-5.2.1/lib/action_view/template.rb:157:in `render'
    /usr/local/bundle/gems/actionview-5.2.1/lib/action_view/renderer/template_renderer.rb:54:in `block (2 levels) in render_template'
    /usr/local/bundle/gems/actionview-5.2.1/lib/action_view/renderer/abstract_renderer.rb:44:in `block in instrument'
    /usr/local/bundle/gems/activesupport-5.2.1/lib/active_support/notifications.rb:168:in `block in instrument'
    /usr/local/bundle/gems/activesupport-5.2.1/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
    /usr/local/bundle/gems/activesupport-5.2.1/lib/active_support/notifications.rb:168:in `instrument'
    /usr/local/bundle/gems/actionview-5.2.1/lib/action_view/renderer/abstract_renderer.rb:43:in `instrument'
    /usr/local/bundle/gems/actionview-5.2.1/lib/action_view/renderer/template_renderer.rb:53:in `block in render_template'
    /usr/local/bundle/gems/actionview-5.2.1/lib/action_view/renderer/template_renderer.rb:61:in `render_with_layout'
    /usr/local/bundle/gems/actionview-5.2.1/lib/action_view/renderer/template_renderer.rb:52:in `render_template'
    /usr/local/bundle/gems/actionview-5.2.1/lib/action_view/renderer/template_renderer.rb:16:in `render'
    /usr/local/bundle/gems/actionview-5.2.1/lib/action_view/renderer/renderer.rb:44:in `render_template'
    /usr/local/bundle/gems/actionview-5.2.1/lib/action_view/renderer/renderer.rb:25:in `render'
    /usr/local/bundle/gems/actionview-5.2.1/lib/action_view/rendering.rb:103:in `_render_template'
    /usr/local/bundle/gems/actionpack-5.2.1/lib/action_controller/metal/streaming.rb:219:in `_render_template'
    /usr/local/bundle/gems/actionview-5.2.1/lib/action_view/rendering.rb:84:in `render_to_body'
    /usr/local/bundle/gems/actionpack-5.2.1/lib/action_controller/metal/rendering.rb:52:in `render_to_body'
    /usr/local/bundle/gems/actionpack-5.2.1/lib/action_controller/metal/renderers.rb:142:in `render_to_body'
    /usr/local/bundle/gems/actionpack-5.2.1/lib/abstract_controller/rendering.rb:46:in `render_to_string'
    /usr/local/bundle/gems/actionpack-5.2.1/lib/action_controller/metal/rendering.rb:41:in `render_to_string'
    /usr/local/bundle/gems/actionpack-5.2.1/lib/action_controller/renderer.rb:83:in `render'
    /usr/local/bundle/gems/jets-1.0.9/lib/jets/controller/renderers/template_renderer.rb:16:in `render'
    /usr/local/bundle/gems/jets-1.0.9/lib/jets/controller/rendering.rb:30:in `render'
    /usr/local/bundle/gems/jets-1.0.9/lib/jets/internal/app/controllers/jets/public_controller.rb:25:in `show'
    /usr/local/bundle/gems/jets-1.0.9/lib/jets/controller/base.rb:24:in `process'
    /usr/local/bundle/gems/jets-1.0.9/lib/jets/poly_fun.rb:25:in `run'
    /usr/local/bundle/gems/jets-1.0.9/lib/jets/server/lambda_aws_proxy.rb:23:in `response'
    /usr/local/bundle/gems/jets-1.0.9/lib/jets/server/api_gateway.rb:10:in `call'
    /usr/local/bundle/gems/jets-1.0.9/lib/jets/server.rb:14:in `call'
    /usr/local/bundle/bundler/gems/webpacker-a8c46614c675/lib/webpacker/dev_server_proxy.rb:18:in `perform_request'
    /usr/local/bundle/gems/rack-proxy-0.6.5/lib/rack/proxy.rb:57:in `call'
    /usr/local/bundle/gems/jets-1.0.9/lib/jets/server/timing_middleware.rb:12:in `call'
    /usr/local/bundle/gems/rack-2.0.5/lib/rack/urlmap.rb:68:in `block in call'
    /usr/local/bundle/gems/rack-2.0.5/lib/rack/urlmap.rb:53:in `each'
    /usr/local/bundle/gems/rack-2.0.5/lib/rack/urlmap.rb:53:in `call'
    /usr/local/bundle/gems/rack-2.0.5/lib/rack/builder.rb:153:in `call'
    /usr/local/bundle/gems/jets-1.0.9/lib/jets/application/middleware.rb:11:in `call'
    /usr/local/bundle/gems/rack-2.0.5/lib/rack/lint.rb:49:in `_call'
    /usr/local/bundle/gems/rack-2.0.5/lib/rack/lint.rb:37:in `call'
    /usr/local/bundle/gems/rack-2.0.5/lib/rack/show_exceptions.rb:23:in `call'
    /usr/local/bundle/gems/rack-2.0.5/lib/rack/common_logger.rb:33:in `call'
    /usr/local/bundle/gems/shotgun-0.9.2/lib/shotgun/loader.rb:86:in `proceed_as_child'
    /usr/local/bundle/gems/shotgun-0.9.2/lib/shotgun/loader.rb:31:in `call!'
    /usr/local/bundle/gems/shotgun-0.9.2/lib/shotgun/loader.rb:18:in `call'
    /usr/local/bundle/gems/shotgun-0.9.2/lib/shotgun/favicon.rb:12:in `call'
    /usr/local/bundle/gems/shotgun-0.9.2/lib/shotgun/static.rb:14:in `call'
    /usr/local/bundle/gems/rack-2.0.5/lib/rack/urlmap.rb:68:in `block in call'
    /usr/local/bundle/gems/rack-2.0.5/lib/rack/urlmap.rb:53:in `each'
    /usr/local/bundle/gems/rack-2.0.5/lib/rack/urlmap.rb:53:in `call'
    /usr/local/bundle/gems/rack-2.0.5/lib/rack/builder.rb:153:in `call'
    /usr/local/bundle/gems/rack-2.0.5/lib/rack/handler/webrick.rb:86:in `service'
    /usr/local/lib/ruby/2.5.0/webrick/httpserver.rb:140:in `service'
    /usr/local/lib/ruby/2.5.0/webrick/httpserver.rb:96:in `run'
    /usr/local/lib/ruby/2.5.0/webrick/server.rb:307:in `block in start_thread'

After I remove the emoji from the content it works correctly.

tongueroo commented 6 years ago

@onnimonni Thanks once again. Bummer. O well, removed the ๐ŸŽ‰ emoji from the starter index.html. Released in 1.0.10 Changelog