Agile Development with Ruby on Rails

Hello,
I bought the PDF version of the book yesterday. I'm having problems
creating a new application. Here's what I did, as per the book's
instructions:

1. Installed Rails: gem install rails
2. Created a working directory: md c:\work
3. Navigated to it: cd work
4. Created a rails application: rails demo
5. cd demo
6. Started WEBrick: ruby script/server
WEBrick started, using port 3000.
7. Pointed browser to: http://localhost:3000/
And this is where I get the "Seeing this instead of the website you
expected?" Apache page, instead of the Rails application. I turned off
the Apache service, just in case, but no success.
Any ideas on how I may solve this problem?
Thanks,
gk

You're still seeing Apache pages after you turn off Apache?

···

On 6/29/05, Jenjhiz <jenjhiz@yahoo.com> wrote:

Hello,
I bought the PDF version of the book yesterday. I'm having problems
creating a new application. Here's what I did, as per the book's
instructions:

1. Installed Rails: gem install rails
2. Created a working directory: md c:\work
3. Navigated to it: cd work
4. Created a rails application: rails demo
5. cd demo
6. Started WEBrick: ruby script/server
WEBrick started, using port 3000.
7. Pointed browser to: http://localhost:3000/
And this is where I get the "Seeing this instead of the website you
expected?" Apache page, instead of the Rails application. I turned off
the Apache service, just in case, but no success.
Any ideas on how I may solve this problem?
Thanks,
gk

I bought the PDF version of the book yesterday. I'm having problems
creating a new application. Here's what I did, as per the book's
instructions:

1. Installed Rails: gem install rails

The book is written to Rails pre-0.13 and you've downloaded 0.12. You can
get this bleeding edge Rails like this:
   gem install --source gems.rubyonrails.com

This won't cause your problem below, though, that Joe, Curt and Virender
have been helping with.

...
6. Started WEBrick: ruby script/server
WEBrick started, using port 3000.
7. Pointed browser to: http://localhost:3000/
And this is where I get the "Seeing this instead of the website you
expected?" Apache page, instead of the Rails application. I turned off
the Apache service, just in case, but no success.
Any ideas on how I may solve this problem?

If Apache is answering, it means it "owns" port 3000. Only one service can
listen to a particular port at any given time.
You could shut down Apache, then run script/server, then open the browser
(and flush your cache and refresh to make sure you're not getting a stale
page).
But I imagine you want Apache and WEBrick to co-exist at some point. Check
Apache's httpd.conf for the Listen directive. I have a line in mine that
says:
    Listen 80
I guess you have a "Listen 3000" line somewhere there. Pick a number that
isn't Apache's and do like this:

    ruby script/server -p 8765

(where 8765 is a number that isn't used)

HTH,
Dave

···

"Jenjhiz" <jenjhiz@yahoo.com> wrote:

Joe Van Dyk wrote:

···

On 6/29/05, Jenjhiz <jenjhiz@yahoo.com> wrote:

Hello,
I bought the PDF version of the book yesterday. I'm having problems
creating a new application. Here's what I did, as per the book's
instructions:

1. Installed Rails: gem install rails
2. Created a working directory: md c:\work
3. Navigated to it: cd work
4. Created a rails application: rails demo
5. cd demo
6. Started WEBrick: ruby script/server
WEBrick started, using port 3000.
7. Pointed browser to: http://localhost:3000/
And this is where I get the "Seeing this instead of the website you
expected?" Apache page, instead of the Rails application. I turned off
the Apache service, just in case, but no success.
Any ideas on how I may solve this problem?
Thanks,
gk

You're still seeing Apache pages after you turn off Apache?

Maybe you're seeing your browser cache -- try clearing the cache.

Curt

What do you get when you try http://127.0.0.1:3000/
?

···

-----Original Message-----
From: Curt Hibbs [mailto:curt@hibbs.com]
Sent: Wednesday, June 29, 2005 11:53 PM
To: ruby-talk ML
Subject: Re: Agile Development with Ruby on Rails

Joe Van Dyk wrote:

On 6/29/05, Jenjhiz <jenjhiz@yahoo.com> wrote:

Hello,
I bought the PDF version of the book yesterday. I'm having problems
creating a new application. Here's what I did, as per the book's
instructions:

1. Installed Rails: gem install rails
2. Created a working directory: md c:\work
3. Navigated to it: cd work
4. Created a rails application: rails demo
5. cd demo
6. Started WEBrick: ruby script/server
WEBrick started, using port 3000.
7. Pointed browser to: http://localhost:3000/
And this is where I get the "Seeing this instead of the website you
expected?" Apache page, instead of the Rails application. I turned off

the Apache service, just in case, but no success. Any ideas on how I
may solve this problem? Thanks,
gk

You're still seeing Apache pages after you turn off Apache?

Maybe you're seeing your browser cache -- try clearing the cache.

Curt

Thanks to all who replied.
To Virender Dogra:
Yes, http://127.0.0.1:3000/ shows the Rails application
To Curt Hibbs:
After clearing the cache, yes, the browser shows the Rails application.
(I'm using FireFox, configured to "remember nothing", but obviously I
missed something.)
To Dave Burt:
Yes, there is a Listen 3000 in Apache's httpd.conf. After replacing
3000 with something else, /localhost:3000/ now gives me the Rails
application.

I'm off and running on Rails (until the next bump). I can't wait to
find out what all this interest in Rails is all about!
gk

Also if you are just starting on rails you may want to read my blog
entry about how to use sqlite( < 5 minutes to setup) instead of mysql(>
5 minutes to setup :wink: for the database

http://vdogra-ruby.blogspot.com/

- Virender

···

-----Original Message-----
From: Jenjhiz [mailto:jenjhiz@yahoo.com]
Sent: Thursday, June 30, 2005 11:21 PM
To: ruby-talk ML
Subject: Re: Agile Development with Ruby on Rails

Thanks to all who replied.
To Virender Dogra:
Yes, http://127.0.0.1:3000/ shows the Rails application
To Curt Hibbs:
After clearing the cache, yes, the browser shows the Rails application.
(I'm using FireFox, configured to "remember nothing", but obviously I
missed something.) To Dave Burt: Yes, there is a Listen 3000 in Apache's
httpd.conf. After replacing 3000 with something else, /localhost:3000/
now gives me the Rails application.

I'm off and running on Rails (until the next bump). I can't wait to find
out what all this interest in Rails is all about! gk

Virender,
I do intend to use SQLite mostly in my projects, rather than MySQL,
although for exploring Rails I opted for MySQL
Thank you for letting me know about your blog.
gk.