[Nitro] Nitro 0.27 troubles
Aleksi Niemela
Aleksi.Niemela at cs.helsinki.fi
Sun Jan 22 10:56:49 EST 2006
Hello,
I want to see if there's anyone else with troubling Nitro 0.27. My app
worked well with 0.25. Then I updated to 0.27 and it stopped working.
Client won't get even the first page. Nitro says it has compiled the
xhtml-file but then gives out nothing to the client.
Now, I've been able to make simple script with same behavior. If I tell
Og to Foo.find_by_bar() directly everything works out well. If the same
is done inside Prototype controller it hangs. George wasn't able to pin
down the reason for this, so I wonder if anyone has bumped into it and
maybe even solved it. If no one else has this behavior I suspect there's
something very wrong with my setup. I installed gems through gem update.
I'll remove all Nitro/Og/Glue installations and see if fresh install
makes it work.
Besides that I'm clueless how to go forward.
- Aleksi
I'm running this on Win XP + Cygwin, ruby-1.8.3, Nitro&rest 0.27
installed from gems automatically (not manually fetched and installed),
Postgres-pr 0.4.0.
Here's the code:
#!/usr/bin/env ruby
require 'nitro'
require 'og'
class Foo
property :bar, String
def initialize(bar)
@bar = bar
end
end
class Configuration
attr_accessor :db, :webserver
def initialize
@db = {
:address => "localhost",
:destroy => false,
:name => "devel_foobar",
:store => "psql",
:user => "foo",
:password => "foobar",
:connection_count => 1
}
end
end
config = Configuration.new
puts "Setting up connection to ###
#{config.db[:address]}:#{config.db[:name]}"
Og.setup(config.db)
class Proto
def foo
puts "finding"
foo = Foo.find_by_bar("bar")
puts "found #{foo.oid}"
%{<html><body><h1>#{foo.bar}</h1></body></html>}
end
end
if $0 == __FILE__
if ARGV.shift == "og"
Foo.create("bar")
p Foo.find_by_bar("bar")
else
Nitro.run(Proto)
end
end
#################
#################
And here're the outputs, first with just Og:
$ ruby problematic_run.rb og
Setting up connection to ### localhost:devel_centerpiece
I, [2006-01-22T17:51:45.722000 #4520] INFO -- : Og uses the Psql store.
I, [2006-01-22T17:51:46.575000 #4520] INFO -- : Created table 'ogfoo'.
D, [2006-01-22T17:51:46.637000 #4520] DEBUG -- : PostgreSQL processing
foreign key constraints
D, [2006-01-22T17:51:46.646000 #4520] DEBUG -- : PostgreSQL finished
setting constraints. No action was taken in 0.00 se
conds.
#<Foo:0x1089a148 @oid=1, @bar="bar">
$ ruby problematic_run.rb
Setting up connection to ### localhost:devel_centerpiece
I, [2006-01-22T17:52:00.825125 #5152] INFO -- : Og uses the Psql store.
D, [2006-01-22T17:52:01.421125 #5152] DEBUG -- : Table ogfoo already exists
D, [2006-01-22T17:52:01.480125 #5152] DEBUG -- : PostgreSQL processing
foreign key constraints
D, [2006-01-22T17:52:01.480125 #5152] DEBUG -- : PostgreSQL finished
setting constraints. No action was taken in 0.00 se
conds.
==> Setup for debug mode
==> Listening at 0.0.0.0:9999.
==> Press Ctrl-C to shutdown; Run with --help for options.
[2006-01-22 17:52:01] INFO WEBrick 1.3.1
[2006-01-22 17:52:01] INFO ruby 1.8.3 (2005-09-21) [i386-cygwin]
[2006-01-22 17:52:01] INFO WEBrick::HTTPServer#start: pid=5152 port=9999
D, [2006-01-22T17:52:02.355125 #5152] DEBUG -- : Rendering '/foo'.
D, [2006-01-22T17:52:02.356125 #5152] DEBUG -- : Compiling action
'Proto#foo'
finding
More information about the Nitro-general
mailing list