[Nitro] Problem with Nitro In Flames tutorial

Jos Backus jos at catnook.com
Fri Dec 23 16:55:37 EST 2005


On Fri, Dec 23, 2005 at 01:19:23PM -0800, Jos Backus wrote:
> On Fri, Dec 23, 2005 at 03:12:28PM +0000, rob wrote:
> > Have you mapped the correct controller to the / path?
>  
> I tried that. See my response to Chris.
 
Oops, my response to Chris was private. But it doesn't work:

Nitro.run(TodoController)

gives

lizzy:~/public_html/nitro/todo% ruby run.rb 
D, [2005-12-23T13:53:58.174095 #37880] DEBUG -- : Using memory sessions.
nil
I, [2005-12-23T13:53:59.268807 #37880]  INFO -- : Og uses the Mysql store.
/usr/local/lib/ruby/gems/1.8/gems/nitro-0.26.0/lib/nitro/compiler/elements.rb:34:in `const_get': uninitialized constant SystemPage (NameError)
        from /usr/local/lib/ruby/gems/1.8/gems/nitro-0.26.0/lib/nitro/compiler/elements.rb:34:in `tag_start'
        from /usr/local/lib/ruby/1.8/rexml/parsers/streamparser.rb:24:in `parse'
        from /usr/local/lib/ruby/1.8/rexml/document.rb:171:in `parse_stream'
        from /usr/local/lib/ruby/gems/1.8/gems/nitro-0.26.0/lib/nitro/compiler/elements.rb:100:in `transform'
        from /usr/local/lib/ruby/gems/1.8/gems/nitro-0.26.0/lib/nitro/compiler/elements.rb:92:in `transform'
        from /usr/local/lib/ruby/gems/1.8/gems/nitro-0.26.0/lib/nitro/compiler.rb:96:in `transform_template'
        from /usr/local/lib/ruby/gems/1.8/gems/nitro-0.26.0/lib/nitro/scaffolding.rb:103:in `define_controller_action'
        from /usr/local/lib/ruby/gems/1.8/gems/nitro-0.26.0/lib/nitro/scaffolding.rb:140:in `scaffold_controller'
         ... 10 levels...
        from /usr/local/lib/ruby/gems/1.8/gems/nitro-0.26.0/lib/nitro/server.rb:89:in `start'
        from /usr/local/lib/ruby/gems/1.8/gems/nitro-0.26.0/lib/nitro/server.rb:121:in `run'
        from /usr/local/lib/ruby/gems/1.8/gems/nitro-0.26.0/lib/nitro.rb:73:in `run'
        from run.rb:18
lizzy:~/public_html/nitro/todo%

and

Nitro.map["/"] = TodoController
Nitro.run

yields

lizzy:~/public_html/nitro/todo% ruby run.rb
D, [2005-12-23T13:54:33.325165 #37940] DEBUG -- : Using memory sessions.
nil
I, [2005-12-23T13:54:33.827597 #37940]  INFO -- : Og uses the Mysql store.
run.rb:19: undefined method `map' for Nitro:Module (NoMethodError)
lizzy:~/public_html/nitro/todo% 

run.rb is

#!/usr/bin/env ruby

require 'nitro'
require 'og'

require 'src/model.rb'
require 'src/controller.rb'

#require 'part/admin'

Og.setup(
  :store => :mysql,
  :name => 'todo',
  :user => 'jos',
  :password => '********'
)

#Nitro.run(TodoController)
Nitro.map["/"] = TodoController
Nitro.run

Jos

> Thanks,
> Jos
> 
> > On 22 Dec 2005, at 22:14, Jos Backus wrote:
> > 
> > >Next problem: I added src/controller.rb per the tutorial and while  
> > >trying to
> > >access http://host/items I see:
> > >
> > >E, [2005-12-22T14:11:18.255399 #25040] ERROR -- : Error while handling
> > >'/items'.
> > >E, [2005-12-22T14:11:18.255729 #25040] ERROR -- : No action to  
> > >dispatch to on
> > >Nitro::Controller
> > >  /usr/local/lib/ruby/gems/1.8/gems/nitro-0.26.0/lib/nitro/ 
> > >dispatcher.rb:202:in
> > >  `dispatch'
> > >
> > >src/controller.rb looks like:
> > >
> > >    class TodoController < Nitro::Controller
> > >      scaffold TodoList
> > >      scaffold Item
> > >    end
> > >
> > >What am I missing?
> > >
> > >-- 
> > >Jos Backus
> > >jos at catnook.com
> > >_______________________________________________
> > >Nitro-general mailing list
> > >Nitro-general at rubyforge.org
> > >http://rubyforge.org/mailman/listinfo/nitro-general
> > 
> > 
> 
> -- 
> Jos Backus
> jos at catnook.com
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general
> 

-- 
Jos Backus
jos at catnook.com



More information about the Nitro-general mailing list