Skip to content

Instantly share code, notes, and snippets.

@michelc
Created November 25, 2010 08:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michelc/715060 to your computer and use it in GitHub Desktop.
Save michelc/715060 to your computer and use it in GitHub Desktop.
C:\Ruby\_projets\bug>ruby main.rb
== Sinatra/1.1.0 has taken the stage on 3000 for development with backup from WEBrick
[2010-11-25 08:52:36] INFO WEBrick 1.3.1
[2010-11-25 08:52:36] INFO ruby 1.9.1 (2010-07-02) [i386-mingw32]
[2010-11-25 08:52:36] INFO WEBrick::HTTPServer#start: pid=3328 port=3000
Encoding::InvalidByteSequenceError - "\xC3" on US-ASCII:
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:465:in `encode'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:465:in `render'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:362:in `erb'
./views/main.rhtml:9:in `__tilt_7971cf99b99f4521191add94b12ea35e'
C:/Ruby/lib/ruby/gems/1.9.1/gems/tilt-1.1/lib/tilt.rb:192:in `evaluate'
C:/Ruby/lib/ruby/gems/1.9.1/gems/tilt-1.1/lib/tilt.rb:128:in `render'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:452:in `render'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:362:in `erb'
main.rb:19:in `block in <class:MyApp>'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:1033:in `call'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:1033:in `block in compile!'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:620:in `instance_eval'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:620:in `route_eval'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:604:in `block (2 levels) in route!'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:656:in `block in process_route'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:653:in `catch'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:653:in `process_route'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:603:in `block in route!'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:602:in `each'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:602:in `route!'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:741:in `dispatch!'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:530:in `block in call!'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:706:in `instance_eval'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:706:in `block in invoke'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:706:in `catch'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:706:in `invoke'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:530:in `call!'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:516:in `call'
C:/Ruby/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/showexceptions.rb:24:in `call'
C:/Ruby/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/commonlogger.rb:18:in `call'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:1142:in `block in call'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:1168:in `synchronize'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:1142:in `call'
C:/Ruby/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/content_length.rb:13:in `call'
C:/Ruby/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/handler/webrick.rb:52:in `service'
C:/Ruby/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
C:/Ruby/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
C:/Ruby/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
Encoding::InvalidByteSequenceError: "\xC3" on US-ASCII
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:465:in `encode'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:465:in `render'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:362:in `erb'
./views/main.rhtml:9:in `__tilt_7971cf99b99f4521191add94b12ea35e'
C:/Ruby/lib/ruby/gems/1.9.1/gems/tilt-1.1/lib/tilt.rb:192:in `evaluate'
C:/Ruby/lib/ruby/gems/1.9.1/gems/tilt-1.1/lib/tilt.rb:128:in `render'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:452:in `render'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:362:in `erb'
main.rb:19:in `block in <class:MyApp>'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:1033:in `call'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:1033:in `block in compile!'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:620:in `instance_eval'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:620:in `route_eval'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:604:in `block (2 levels) in route!'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:656:in `block in process_route'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:653:in `catch'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:653:in `process_route'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:603:in `block in route!'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:602:in `each'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:602:in `route!'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:741:in `dispatch!'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:530:in `block in call!'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:706:in `instance_eval'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:706:in `block in invoke'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:706:in `catch'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:706:in `invoke'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:530:in `call!'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:516:in `call'
C:/Ruby/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/showexceptions.rb:24:in `call'
C:/Ruby/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/commonlogger.rb:18:in `call'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:1142:in `block in call'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:1168:in `synchronize'
C:/Ruby/lib/ruby/gems/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:1142:in `call'
C:/Ruby/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/content_length.rb:13:in `call'
C:/Ruby/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/handler/webrick.rb:52:in `service'
C:/Ruby/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
C:/Ruby/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
C:/Ruby/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
127.0.0.1 - - [25/Nov/2010 08:52:42] "GET / HTTP/1.1" 500 106004 0.3670
vostro1520 - - [25/Nov/2010:08:52:42 Paris, Madrid] "GET / HTTP/1.1" 500 106004
- -> /
127.0.0.1 - - [25/Nov/2010 08:52:42] "GET /__sinatra__/500.png HTTP/1.1" 304 - 0.0250
vostro1520 - - [25/Nov/2010:08:52:42 Paris, Madrid] "GET /__sinatra__/500.png HTTP/1.1" 304 0
Referer -> /__sinatra__/500.png
#!/usr/bin/env ruby
#Encoding: UTF-8
require "erb"
require "sinatra/base"
require "lib/tilt" # use my "own" tilt prefixed with encoding: UTF-8
class MyApp < Sinatra::Base
set :app_file, __FILE__
set :root, File.dirname(__FILE__)
configure :development do
enable :logging
enable :dump_errors
set :bind, "localhost"
end
get "/" do
erb :main
end
end
MyApp.run! :host => "localhost", :port => 3000
ä
Some text with special char ä here
# encoding: UTF-8
require 'digest/md5'
module Tilt
VERSION = '1.1'
@template_mappings = {}
# Hash of template path pattern => template implementation class mappings.
def self.mappings
@template_mappings
end
etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment