Rolling with Ruby on Rails
Subject:   Error after generating Recipe controller
Date:   2005-10-15 13:37:32
From:   daveisaacs
After the step "ruby script\generate controller Recipe", when I go to I get the following error:

---start error---
ActionController::RoutingError in Recipe#new

Showing c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/templates/scaffolds/new.rhtml where line #4 raised:

No url can be generated for the hash {:id=>"", :action=>"create"}

Extracted source (around line #4):

1: <h1>New <%= @scaffold_singular_name %></h1>
3: <%= error_messages_for(@scaffold_singular_name) %>
4: <%= form(@scaffold_singular_name, :action => "create#{@scaffold_suffix}") %>
6: <%= link_to "Back", :action => "list#{@scaffold_suffix}" %>
---end error---

Any ideas?


Dave I

Full Threads Oldest First

Showing messages 1 through 4 of 4.

  • Curt Hibbs photo Error after generating Recipe controller
    2005-10-15 16:01:40  Curt Hibbs | O'Reilly AuthorO'Reilly Blogger [View]

    Did you generate your model with the correct name (i.e. no typos)?

    Try comparing your source code with the workign source code that you can download:

    • Error after generating Recipe controller
      2005-10-15 19:30:55  daveisaacs [View]

      I've double and triple checked against the downloadable version, and there is no problems that I can see.

      However, when I tried starting the server from from downloadable version, I get error shown below. I am wondering if I have some sort of ruby/rails version incompatibility problem.

      I am going to uninstall and start again from the beginning.


      Dave I

      c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:139:in `activate': (Gem::LoadError)
      Could not find RubyGem actionwebservice (> 0.0.0)
      from c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:42:in `require_gem'
      from ./script/../config/environment.rb:35
      from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5:in `r
      from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5:in `r
      from script/server:45

      • Error after generating Recipe controller
        2005-10-15 20:06:05  daveisaacs [View]

        OK, I seem to be working now. I uninstalled all my Ruby (version 1.8.2-14 Stable) and installed the latest version Final.

        What do I think happened? Well, during install, I got the same problem that onestar was describing below. When executing "gem install rails --remote", I would only get rails_analyzer installed. So I instead forced the install of the 0.9.4 version by specifying "-v 0.9.4" on the command line. I guess rails 0.9.4 and ruby 1.8.2-15 do not play well together.


        Dave I
        • Error after generating Recipe controller
          2005-11-05 19:52:15  jeffvott [View]

          How did you eventually solve this problem. I am getting the same thing. What versions of Ruby/Rails did you end up using?