Very Newbie Question - script/generate model

Hi All,

I am working the 20 minute wiki tutorial http://sl33p3r.free.fr/tutorials/rails/wiki/wiki-en.html. Right at the beginning after I get my web server up I try to create the Page model in the command line:

script/generate model Page

After I hit Enter nothing happens. I've searched online and used the ruby invoker, but still nothing happens. I recently installed the latest version of RoR on my mac leopard, and installed all the gems, so everything should be up to date.

Am I missing something?

rails newapp cd newapp ruby script/generate model Page

does that give anything?

heimdull wrote:

rails newapp cd newapp ruby script/generate model Page

does that give anything?

Hi heimdull,

Yes, it generates the following, which is what shows in the tutorial:

exists app/models/       exists test/unit/       exists test/fixtures/       create app/models/page.rb       create test/unit/page_test.rb       create test/fixtures/pages.yml       create db/migrate       create db/migrate/20080926000217_create_pages.rb

I forgot to mention I am running latest version of the mongrel server.

Hi all,

I am still experiencing this problem. I tried installing the latest version of RoR and mogrel again, but I am still experiencing this problem. If anyone has any idea as to why this may be happening, please reply! I'm really excited about my first journey into RoR and web programming, but this is killing me!

Hi all,

I am still experiencing this problem. I tried installing the latest version of RoR and mogrel again, but I am still experiencing this problem. If anyone has any idea as to why this may be happening, please reply! I'm really excited about my first journey into RoR and web programming, but this is killing me!

Well the version of mongrel is irrelevant - it's not even running at this point. I have on occasion seen a slightly odd thing where ruby had printed something like 'Do you want to overwrite x' but that prompt doesn't show up unless you hit enter or otherwise force the window to redraw itself (eg resize)

Fred

Frederick Cheung wrote:

then what's the problem?

Frederick Cheung wrote:

On Sep 27, 4:03�am, Chris To <rails-mailing-l...@andreas-s.net> wr ote:

Hi all,

I am still experiencing this problem. I tried installing the latest version of RoR and mogrel again, but I am still experiencing this problem. If anyone has any idea as to why this may be happening,
please reply! I'm really excited about my first journey into RoR and web programming, but this is killing me!

Well the version of mongrel is irrelevant - it's not even running at this point. I have on occasion seen a slightly odd thing where ruby had printed something like 'Do you want to overwrite x' but that prompt doesn't show up unless you hit enter or otherwise force the window to redraw itself (eg resize)

Fred

Hi Fred,

The problem is when I've already entered the script/server and got the welcome aboard screen when I point my browser to port 3000. If I don't start the server, I generate the model. How is mongrel not running irrelevant, all the evidence points to the webserver being the
problem..

Well that's the first time you've said that running a mongrel makes a
difference as far as I can tell. When it hangs when running the
generator do you know where it is blocked? (eg if you control c it do
you get an interesting backtrace)?

Hassan Schroeder wrote:

Frederick Cheung wrote:

Sent from my iPhone

reply! I'm really excited about my first journey into RoR and web

Hi Fred,

The problem is when I've already entered the script/server and got the welcome aboard screen when I point my browser to port 3000. If I don't start the server, I generate the model. How is mongrel not running irrelevant, all the evidence points to the webserver being the
problem..

Well that's the first time you've said that running a mongrel makes a difference as far as I can tell. When it hangs when running the generator do you know where it is blocked? (eg if you control c it do you get an interesting backtrace)?

Hi Fred,

Sorry about that, I didn't realize I only mentioned mongrel once in my posts. Here is what I get:

=> Booting Mongrel (use 'script/server webrick' to force WEBrick) => Rails 2.1.1 application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server ** Starting Mongrel listening at 0.0.0.0:3000 ** Starting Rails with development environment... ** Rails loaded. ** Loading any Rails specific GemPlugins ** Signals ready. TERM => stop. USR2 => restart. INT => stop (no restart). ** Rails signals registered. HUP => reload (without restart). It might not work well. ** Mongrel 1.1.5 available at 0.0.0.0:3000 ** Use CTRL-C to stop. script/generate model Page (Nothing happens...then I just press cntrl + C) ^C** INT signal received. Exiting

I hope this helps. Thanks for helping me with my question.

You need to do these commands from a shell prompt. Once you've started the server in a window, you no longer have that prompt. So open another window (or tab) to run other commands.