"Hello World" with Cramp

131 views Asked by At

I decided the much ignored but nonetheless amazing looking Cramp framework might be worth forking and picking up. I tried a basic hello world. However, it blows up on me:

/home/redmage/.rvm/gems/ruby-2.0.0-p247@global/gems/cramp-0.15.1/lib/cramp/abstract.rb:5:in `<class:Abstract>': /home/redmage/.rvm/gems/ruby-2.0.0-p247@global/gems/cramp-0.15.1/lib/cramp/callbacks.rb:81: invalid multibyte escape: /\000([^\377]*)\377/ (SyntaxError)
invalid multibyte escape: /^\x00|\xff$/
  from /home/redmage/.rvm/gems/ruby-2.0.0-p247@global/gems/cramp-0.15.1/lib/cramp/abstract.rb:4:in `<module:Cramp>'
  from /home/redmage/.rvm/gems/ruby-2.0.0-p247@global/gems/cramp-0.15.1/lib/cramp/abstract.rb:3:in `<top (required)>'
  from /home/redmage/.rvm/gems/ruby-2.0.0-p247@global/gems/cramp-0.15.1/lib/cramp/action.rb:2:in `<module:Cramp>'
  from /home/redmage/.rvm/gems/ruby-2.0.0-p247@global/gems/cramp-0.15.1/lib/cramp/action.rb:1:in `<top (required)>'
  from app/actions/home_action.rb:3:in `<top (required)>'
  from /home/redmage/.rvm/gems/ruby-2.0.0-p247@global/gems/thin-1.5.1/lib/thin/controllers/controller.rb:178:in `load'
  from /home/redmage/.rvm/gems/ruby-2.0.0-p247@global/gems/thin-1.5.1/lib/thin/controllers/controller.rb:178:in `load_rackup_config'
  from /home/redmage/.rvm/gems/ruby-2.0.0-p247@global/gems/thin-1.5.1/lib/thin/controllers/controller.rb:71:in `start'
  from /home/redmage/.rvm/gems/ruby-2.0.0-p247@global/gems/thin-1.5.1/lib/thin/runner.rb:187:in `run_command'
  from /home/redmage/.rvm/gems/ruby-2.0.0-p247@global/gems/thin-1.5.1/lib/thin/runner.rb:152:in `run!'
  from /home/redmage/.rvm/gems/ruby-2.0.0-p247@global/gems/thin-1.5.1/bin/thin:6:in `<top (required)>'
  from /home/redmage/.rvm/gems/ruby-2.0.0-p247@global/bin/thin:23:in `load'
  from /home/redmage/.rvm/gems/ruby-2.0.0-p247@global/bin/thin:23:in `<main>'
  from /home/redmage/.rvm/gems/ruby-2.0.0-p247@global/bin/ruby_noexec_wrapper:14:in `eval'
  from /home/redmage/.rvm/gems/ruby-2.0.0-p247@global/bin/ruby_noexec_wrapper:14:in `<main>'

The code is exactly like in the example on cramp.in :

require 'cramp'

class HomeAction < Cramp::Action
  def start
    render "Hello World!"
    finish
  end 
end

And I run it via:

thin --timeout 0 -R app/actions/home_action.rb start

Any ideas about what to do or how to fix this?

0

There are 0 answers