Unable to stop Sinatra using Ctrl + C when `require 'coffee-script'`

I am running Ruby 1.9.2p180 on Ubuntu 11.04 64-bit.

I have the simplest CoffeeScript example using Sinatra , which works fine but does not stop when I click the shortcut Ctrl+C. Therefore, every time I have to kill -9, and it becomes quite tedious.

app.rb:

require 'sinatra'
require 'coffee-script'

get '/' do
  '<script src="/app.js" type="text/javascript"></script>'
end

get '/app.js' do
  coffee :app
end

views/app.coffee:

alert 'Foo'

It works on Ruby 1.8.7 with minor changes:

require 'rubygems'
require 'sinatra'
require 'coffee-script'
require 'json'

get '/' do
  '<script src="/app.js" type="text/javascript"></script>'
end

get '/app.js' do
  coffee :app
end

It also works on 1.9.2 when I delete a line require 'coffee-script', but gives me a warning:

WARN: tilt autoloading 'coffee_script' in a non thread-safe way; explicit require 'coffee_script' suggested.

, therubyracer, node. 0.1.97 Ubuntu 10.10. 0.2.6 Natty , (0.4.8) nvm 0.1.97 nvm.

+3
2

Ruby 1.9.2, Sinatra 1.3.2, CoffeeScript 2.2.0 Node 0.6.2 .

0

. Mac (OS 10.6.7) bash Ruby 1.9.2p180. tilt.

The Middleman (Sinatra-based) Rails 3.1; coffee-script ( Tilt, , coffee_script - ).

(sinatra, coffee- script, tilt, execjs) ? JS (, node, therubyracer)?

+1

All Articles