Skip to content

Instantly share code, notes, and snippets.

@adelevie
Created January 26, 2010 02:21
Show Gist options
  • Select an option

  • Save adelevie/286477 to your computer and use it in GitHub Desktop.

Select an option

Save adelevie/286477 to your computer and use it in GitHub Desktop.
the error is tripped by this:
purchase = Purchase.all(:id => params[:id])
the error:
C:\Users\adelevie\ruby_apps\expenser>ruby main.rb
== Sinatra/0.9.4 has taken the stage on 4567 for development with backup from Mo
ngrel
NoMethodError: undefined method `bytesize' for #<Purchase:0x5a57738>
C:/Ruby/lib/ruby/gems/1.8/gems/sinatra-0.9.4/lib/sinatra/base.rb:46:in `
finish'
C:/Ruby/lib/ruby/gems/1.8/gems/sinatra-0.9.4/lib/sinatra/base.rb:889:in
`inject'
C:/Ruby/lib/ruby/gems/1.8/gems/sinatra-0.9.4/lib/sinatra/base.rb:45:in `
each'
C:/Ruby/lib/ruby/gems/1.8/gems/sinatra-0.9.4/lib/sinatra/base.rb:45:in `
inject'
C:/Ruby/lib/ruby/gems/1.8/gems/sinatra-0.9.4/lib/sinatra/base.rb:45:in `
finish'
C:/Ruby/lib/ruby/gems/1.8/gems/sinatra-0.9.4/lib/sinatra/base.rb:378:in
`call!'
C:/Ruby/lib/ruby/gems/1.8/gems/sinatra-0.9.4/lib/sinatra/base.rb:364:in
`call'
C:/Ruby/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/showexceptions.rb:24:
in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/methodoverride.rb:24:
in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/commonlogger.rb:18:in
`call'
C:/Ruby/lib/ruby/gems/1.8/gems/sinatra-0.9.4/lib/sinatra/base.rb:898:in
`call'
C:/Ruby/lib/ruby/gems/1.8/gems/sinatra-0.9.4/lib/sinatra/base.rb:943:in
`synchronize'
C:/Ruby/lib/ruby/gems/1.8/gems/sinatra-0.9.4/lib/sinatra/base.rb:898:in
`call'
C:/Ruby/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/content_length.rb:13:
in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/chunked.rb:15:in `cal
l'
C:/Ruby/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/mongrel.rb:67
:in `process'
C:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.
rb:159:in `process_client'
C:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.
rb:158:in `each'
C:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.
rb:158:in `process_client'
C:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.
rb:285:in `run'
C:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.
rb:285:in `initialize'
C:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.
rb:285:in `new'
C:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.
rb:285:in `run'
C:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.
rb:268:in `initialize'
C:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.
rb:268:in `new'
C:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.
rb:268:in `run'
C:/Ruby/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/mongrel.rb:38
:in `run'
C:/Ruby/lib/ruby/gems/1.8/gems/sinatra-0.9.4/lib/sinatra/base.rb:866:in
`run!'
C:/Ruby/lib/ruby/gems/1.8/gems/sinatra-0.9.4/lib/sinatra/main.rb:34
main.rb:58
127.0.0.1 - - [25/Jan/2010 21:18:00] "GET /purchases/edit/549797f0-09f6-11df-9f2
c-f6b97a2eadd4 HTTP/1.1" 500 86232 7.3850
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment