Seth Rasmussen
2005-Sep-18 16:43 UTC
MissingSourceFile in <controller not set>#<action not set>
Hi all, I am having trouble with a Rails error that I do not understand. I found a thread on the Textdrive forums about this, in which the proposed solution was essentially to recreate the Rails app directory. I did this once, and it seemed to work, but I have encountered the error again and tried the same solution with no effect. The subject line of this message is the primary heading on the error page. Here is the rest of that page: ------------------------------------------------------------ No such file to load -- /config/routes.rb server:49 c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support/dependencies.rb:193:in `load'' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support/dependencies.rb:193:in `load'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/routing.rb:530:in `reload'' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/dispatcher.rb:49:in `prepare_application'' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/dispatcher.rb:31:in `dispatch'' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:105:in `handle_dispatch'' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:71:in `service'' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' c:/ruby/lib/ruby/1.8/webrick/server.rb:155:in `start_thread'' c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start'' c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'' c:/ruby/lib/ruby/1.8/webrick/server.rb:94:in `start'' c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `each'' c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `start'' c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start'' c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start'' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:57:in `dispatch'' This error occured while loading the following files: ./../config/../config/routes.rb Request Parameters: None --- {} Response Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"}
Seth Rasmussen
2005-Sep-18 17:31 UTC
Re: MissingSourceFile in <controller not set>#<action not set>
Oh, and just in case: yes, the file is actually there.
Seth Rasmussen
2005-Sep-19 02:23 UTC
Re: MissingSourceFile in <controller not set>#<action not set>
Is this like a total newbie error or something? I''ve searched, but couldn''t find anything more relevant that the Textdrive post which I described. Any help would be greatly appreciated. Thanks.
Ray Baxter
2005-Sep-19 04:56 UTC
Re: Re: MissingSourceFile in <controller not set>#<action not set>
on 9/18/2005 10:31 AM Seth Rasmussen said the following:>Oh, and just in case: yes, the file is actually there. >It is there, but is it readable? Readable by the user running webrick? Ray
Seth Rasmussen
2005-Sep-19 07:14 UTC
Re: Re: MissingSourceFile in <controller not set>#<action not set>
On 9/18/05, Ray Baxter <ray.baxter-mn4gwa5WIIQysxA8WJXlww@public.gmane.org> wrote:> It is there, but is it readable? Readable by the user running webrick?I dunno why it wouldn''t be. I''m running the stuff locally, and I''ve not changed any configuration of anything. I''ve gone through some other tutorials with no problems, and as I said, I even had the current project functioning at one point.
Seth Rasmussen
2005-Sep-19 07:37 UTC
Re: Re: MissingSourceFile in <controller not set>#<action not set>
Ray, I double checked the read status of the directory, and sure enough some of it was read-only. I didn''t assert whether or not routes.rb was one of those, but made the whole directory writeable. This seems to have fixed it! Thanks. :)
Seth Rasmussen
2005-Sep-20 03:02 UTC
Re: Re: MissingSourceFile in <controller not set>#<action not set>
Gah! Spoke too soon!? :..( 1. Run rails command to create a new app directory 2. Edit database.yml to point to the MySQL database that is already created 3. Run "generate scaffold user User" to generate scaffolding to map to "users" table in database 4. Run server script 5. Go to view the scaffolding and I get this error again... ensuring that the whole dir is readable does nothing, even when restarting webrick>:-[I am starting to worry that the simple tutorials that hook people in are not telling the whole story... but also, I know I am a newbie with a lot of this. I just do not see this issue coming up, and nobody has yet provided a "this is exactly what that is and here''s what you do" for it.
Seth Rasmussen
2005-Sep-21 05:44 UTC
Re: Re: MissingSourceFile in <controller not set>#<action not set>
I think I found this page earlier: http://www.glenswinfield.co.uk/general/ruby-on-rails-errors/ But overlooked this detail: "run script/server inside of the top-level directory of your app" I had been entering the /script/ directory to save myself a few keystrokes when running the generators. Is this a bug, or what I get for being uber lazy? ;-p All seems okay now... oy!