Hi!
Camping has switched to Rack (http://rack.rubyforge.org) recently.
This should work:
if __FILE__ == $0
Conf::Models::Base.establish_connection :adapter =>
''sqlite3'', :database
=> ''conf.db''
Conf::Models::Base.logger = Logger.new(''conf.log'')
Conf.create
app = Rack::Builder.new do
use Rack::ContentLength
run Conf
end
trap(''INT'') { exit }
puts "** http://localhost:80/"
t = Time.now
@servertime=t
puts "?? ?? ?? :
#{t.year}?#{t.month}?#{t.day}?#{t.hour}?#{t.min}?#{t.sec}?"
Rack::Handler::Mongrel.run(app, :Port => 80)
end
There are probably more changes you need to do with your code. Just post
here if you''re stuck and we''ll figure out :-)
If don''t want to upgrade, you can keep using the old version of Camping
by
placing this at the top of the file:
require ''rubygems''
gem "camping", "=1.5.180"
require ''camping''
Good luck, and have fun with Camping!
//Magnus Holm
2009/3/22 in-seok hwang <his2000x at gmail.com>
> hi all
>
> i''m can''t speak english well....
>
> i has something problem.
>
> i used gems list is..
> mongrel-1.1.5
> camping-1.5.180
>
> and update now..
>
> camping-1.9.300
>
> so, My blog looks like an error on the server.
>
> my old code is ..
>
> 615 if __FILE__ == $0
> 616 require ''mongrel/camping''
> 617
> 618 Conf::Models::Base.establish_connection :adapter =>
''sqlite3'',
> :database => ''conf.db''
> 619 Conf::Models::Base.logger =
Logger.new(''conf.log'')
> 620 Conf.create
> 621
> 622 config = Mongrel::Configurator.new :host => "0.0.0.0"
do
> 623 listener :port => 80 do
> 624 uri "/", :handler =>
> Mongrel::Camping::CampingHandler.new(Conf)
> 625 uri "/favicon", :handler =>
> Mongrel::Error404Handler.new("")
> 626 trap("INT") { stop }
> 627 run
> 628 end
> 629 end
> 630
> 631 puts "** http://localhost:80/"
> 632 t = Time.now
> 633 @servertime=t
> 634 puts "?? ?? ?? :
> #{t.year}?#{t.month}?#{t.day}?#{t.hour}?#{t.min}?#{t.sec}?"
> 635 config.join
> 636 end
>
> and error code is,
>
>
> his at info105:~$ sudo ruby conf_mongrel1.9.rb
> ** http://localhost:80/
> ?? ?? ?? : 2009?3?22?13?30?25?
> Sun Mar 22 13:30:31 +0900 2009: Read error: #<TypeError:
> #<StringIO:0xb72b8c18> is not a symbol>
> (eval):53:in `const_get''
> (eval):53:in `method_missing''
> /usr/local/lib/site_ruby/1.8/mongrel/camping.rb:53:in `process''
> /usr/local/lib/site_ruby/1.8/mongrel/camping.rb:52:in
`synchronize''
> /usr/local/lib/site_ruby/1.8/mongrel/camping.rb:52:in `process''
> /usr/local/lib/site_ruby/1.8/mongrel.rb:159:in `process_client''
> /usr/local/lib/site_ruby/1.8/mongrel.rb:158:in `each''
> /usr/local/lib/site_ruby/1.8/mongrel.rb:158:in `process_client''
> /usr/local/lib/site_ruby/1.8/mongrel.rb:285:in `run''
> /usr/local/lib/site_ruby/1.8/mongrel.rb:285:in `initialize''
> /usr/local/lib/site_ruby/1.8/mongrel.rb:285:in `new''
> /usr/local/lib/site_ruby/1.8/mongrel.rb:285:in `run''
> /usr/local/lib/site_ruby/1.8/mongrel.rb:268:in `initialize''
> /usr/local/lib/site_ruby/1.8/mongrel.rb:268:in `new''
> /usr/local/lib/site_ruby/1.8/mongrel.rb:268:in `run''
> /usr/local/lib/site_ruby/1.8/mongrel/configurator.rb:282:in `run''
> /usr/local/lib/site_ruby/1.8/mongrel/configurator.rb:281:in `each''
> /usr/local/lib/site_ruby/1.8/mongrel/configurator.rb:281:in `run''
> conf_mongrel1.9.rb:627:in `cloaker_''
> /usr/local/lib/site_ruby/1.8/mongrel/configurator.rb:149:in `call''
> /usr/local/lib/site_ruby/1.8/mongrel/configurator.rb:149:in
`listener''
> conf_mongrel1.9.rb:623:in `cloaker_''
> /usr/local/lib/site_ruby/1.8/mongrel/configurator.rb:50:in `call''
> /usr/local/lib/site_ruby/1.8/mongrel/configurator.rb:50:in
`initialize''
> conf_mongrel1.9.rb:622:in `new''
> conf_mongrel1.9.rb:622
>
>
> plz help..
>
>
>
> _______________________________________________
> Camping-list mailing list
> Camping-list at rubyforge.org
> http://rubyforge.org/mailman/listinfo/camping-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/camping-list/attachments/20090322/93106318/attachment-0001.html>