# New Rails app is not working... I am missing something

**URL:** <https://www.ruby-forum.com/t/new-rails-app-is-not-working-i-am-missing-something/59815>\
**Category:** Rails\
**Created:** [May 7, 2006, 12:18am UTC](https://www.ruby-forum.com/t/new-rails-app-is-not-working-i-am-missing-something/59815 "2006-05-07T00:18:21Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![nitefall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/76d3ee/32.png) [@nitefall](https://www.ruby-forum.com/u/nitefall)\
**Post date:** [May 7, 2006, 12:18am UTC](https://www.ruby-forum.com/t/new-rails-app-is-not-working-i-am-missing-something/59815/1 "2006-05-07T00:18:21Z")

</div>

Hi,  
So I have two rails applications working on my box. Theya re both  
tutorials that I walked through step by step.

Now I am trying to write my own application and something is not  
working.

My server is OS X 10.3.x. I am using Apache 1.3.x as the webserver with  
fcgi.

As I mentioned before all is well with the apps that I had walk through  
tutorials with, but my app is not working.

I think the issue lies with Apache. – OK Here we go

I was able to create my rails app (rails asset\_track)  
I was able to set up my website to point the public directory of my app,  
and I get the “Welcome Aboard” page at [http://example.com/asset/](http://example.com/asset/)  
I was able to create a controller (ruby script/generate scaffold Asset  
Admin)  
but when I go to [www.example.com/asset/admin](http://www.example.com/asset/admin) I get the following

Not Found  
The requested URL /asset/admin was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use  
an ErrorDocument to handle the request.  
Apache/1.3.33 Server at [www.example.com](http://www.example.com) Port 80

What am I missing?

I have copied the settings for the virtual server in httpd.conf  
I have also copied the settings in …/public/.htaccess

Any ideas?

---

<div class="post-metadata">

**Author:** ![nitefall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/76d3ee/32.png) [@nitefall](https://www.ruby-forum.com/u/nitefall)\
**Post date:** [May 7, 2006, 6:12am UTC](https://www.ruby-forum.com/t/new-rails-app-is-not-working-i-am-missing-something/59815/2 "2006-05-07T06:12:05Z")

</div>

Can you run this Rails application with Webrick? Then you will know  
for sure it is Apache.

Peter

---

<div class="post-metadata">

**Author:** ![nitefall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/76d3ee/32.png) [@nitefall](https://www.ruby-forum.com/u/nitefall)\
**Post date:** [May 7, 2006, 10:06am UTC](https://www.ruby-forum.com/t/new-rails-app-is-not-working-i-am-missing-something/59815/3 "2006-05-07T10:06:15Z")

</div>

Peter M. wrote:

> Can you run this Rails application with Webrick? Then you will know  
> for sure it is Apache.
> 
> Peter

How do I do this?

---

<div class="post-metadata">

**Author:** ![nitefall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/76d3ee/32.png) [@nitefall](https://www.ruby-forum.com/u/nitefall)\
**Post date:** [May 7, 2006, 4:31pm UTC](https://www.ruby-forum.com/t/new-rails-app-is-not-working-i-am-missing-something/59815/4 "2006-05-07T16:31:56Z")

</div>

> How do I do this?

Super easy to start webrick.

To create a new app and run it with webrick

$ rails new\_app  
$ cd new\_app  
$ script/server

Then navigate to localhost:3000 to see the Rails welcome page

after that works, try it for your\_app

$ cd your\_app  
$ script/server

Then navigate to localhost:3000 and then navigate to  
localhost:3000/asset/admin

I was surprised you are using apache when webrick is so easy to use  
for development.

Peter

---

<div class="post-metadata">

**Author:** ![nitefall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/76d3ee/32.png) [@nitefall](https://www.ruby-forum.com/u/nitefall)\
**Post date:** [May 8, 2006, 12:27am UTC](https://www.ruby-forum.com/t/new-rails-app-is-not-working-i-am-missing-something/59815/5 "2006-05-08T00:27:42Z")

</div>

Well…

Starting Webrick was easy… I got the following message when went to  
[http://www.example.com/asset/admin/](http://www.example.com/asset/admin/)

Application error

Change this error message for exceptions thrown outside of an action  
(like in Dispatcher setups or broken Ruby code) in public/500.html

I am really uncertain what is not working here.

---

<div class="post-metadata">

**Author:** ![nitefall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/76d3ee/32.png) [@nitefall](https://www.ruby-forum.com/u/nitefall)\
**Post date:** [May 8, 2006, 12:50am UTC](https://www.ruby-forum.com/t/new-rails-app-is-not-working-i-am-missing-something/59815/6 "2006-05-08T00:50:27Z")

</div>

From development.log

Recognition failed for “/asset/admin”  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action\_controller/routing.rb:488:in  
`recognition_failed' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/routing.rb:478:in`recognize!’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb:38:in  
`dispatch' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/webrick_server.rb:115:in`handle\_dispatch’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/webrick\_server.rb:81:in  
`service' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in`service’  
/usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' /usr/local/lib/ruby/1.8/webrick/server.rb:155:in`start\_thread’  
/usr/local/lib/ruby/1.8/webrick/server.rb:144:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:144:in`start\_thread’  
/usr/local/lib/ruby/1.8/webrick/server.rb:94:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:89:in`each’  
/usr/local/lib/ruby/1.8/webrick/server.rb:89:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:79:in`start’  
/usr/local/lib/ruby/1.8/webrick/server.rb:79:in `start' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/webrick_server.rb:67:in`dispatch’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/commands/servers/webrick.rb:59  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:21:in  
`require__' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in`require’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active\_support/dependencies.rb:147:in  
`require' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/commands/server.rb:30 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in`require\_\_’  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:21:in  
`require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in`require’  
script/server:3

---

<div class="post-metadata">

**Author:** ![nitefall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/76d3ee/32.png) [@nitefall](https://www.ruby-forum.com/u/nitefall)\
**Post date:** [May 8, 2006, 12:40am UTC](https://www.ruby-forum.com/t/new-rails-app-is-not-working-i-am-missing-something/59815/7 "2006-05-08T00:40:19Z")

</div>

This file is on the server

asset\_track/app/controllers/admin\_controller.rb

What is going on here… It seems to think that the file is missing…  
But it is there.

---

<div class="post-metadata">

**Author:** ![nitefall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/76d3ee/32.png) [@nitefall](https://www.ruby-forum.com/u/nitefall)\
**Post date:** [May 8, 2006, 1:41am UTC](https://www.ruby-forum.com/t/new-rails-app-is-not-working-i-am-missing-something/59815/8 "2006-05-08T01:41:55Z")

</div>

nitefall wrote:

> Starting Webrick was easy… I got the following message when went to  
> [http://www.example.com/asset/admin/](http://www.example.com/asset/admin/)
> 
> Application error

Do you have a file app/controller/admin\_controller.rb?

–

Ray

---

<div class="post-metadata">

**Author:** ![nitefall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/76d3ee/32.png) [@nitefall](https://www.ruby-forum.com/u/nitefall)\
**Post date:** [May 8, 2006, 12:53am UTC](https://www.ruby-forum.com/t/new-rails-app-is-not-working-i-am-missing-something/59815/9 "2006-05-08T00:53:10Z")

</div>

Perhaps with Apache there is something wrong with mod\_rewirte… but  
the above log entries are all to do with webrick.

I have no idea where to go from here.

---

<div class="post-metadata">

**Author:** ![nitefall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/76d3ee/32.png) [@nitefall](https://www.ruby-forum.com/u/nitefall)\
**Post date:** [May 8, 2006, 1:51am UTC](https://www.ruby-forum.com/t/new-rails-app-is-not-working-i-am-missing-something/59815/10 "2006-05-08T01:51:06Z")

</div>

Ray B. wrote:

> nitefall wrote:
> 
> > Starting Webrick was easy… I got the following message when went  
> > to [http://www.example.com/asset/admin/](http://www.example.com/asset/admin/)
> > 
> > Application error
> 
> Do you have a file app/controller/admin\_controller.rb?

I should have written, “Do you have a file  
app/controller/asset\_controller.rb?”

If you do, does that file have a method admin?

–

Ray

---

<div class="post-metadata">

**Author:** ![nitefall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/76d3ee/32.png) [@nitefall](https://www.ruby-forum.com/u/nitefall)\
**Post date:** [May 8, 2006, 7:19am UTC](https://www.ruby-forum.com/t/new-rails-app-is-not-working-i-am-missing-something/59815/11 "2006-05-08T07:19:35Z")

</div>

Ray B. wrote:

> I should have written, “Do you have a file  
> app/controller/asset\_controller.rb?”
> 
> If you do, does that file have a method admin?
> 
> –
> 
> Ray

Negative… I do not have a file called asset\_controller.rb Perhaps  
because I have not tried to create a scaffold for it yet??

Should I create one?

---

<div class="post-metadata">

**Author:** ![nitefall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/76d3ee/32.png) [@nitefall](https://www.ruby-forum.com/u/nitefall)\
**Post date:** [May 8, 2006, 8:36pm UTC](https://www.ruby-forum.com/t/new-rails-app-is-not-working-i-am-missing-something/59815/12 "2006-05-08T20:36:47Z")

</div>

nitefall wrote:

> Ray B. wrote:
> 
> > I should have written, “Do you have a file  
> > app/controller/asset\_controller.rb?”
> > 
> > If you do, does that file have a method admin?
> 
> Negative… I do not have a file called asset\_controller.rb Perhaps  
> because I have not tried to create a scaffold for it yet??
> 
> Should I create one?

If you want to access the url [http://www.example.com/asset/admin](http://www.example.com/asset/admin) as you  
were doing in an earlier post then need an asset controller that  
contains an admin action.

In that same post you said that you had created an admin controller, so  
perhaps you need to create an asset action in that controller and access  
the url [http://www.example.com/admin/asset](http://www.example.com/admin/asset).

–

Ray

---

<div class="post-metadata">

**Author:** ![nitefall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/76d3ee/32.png) [@nitefall](https://www.ruby-forum.com/u/nitefall)\
**Post date:** [May 9, 2006, 4:12pm UTC](https://www.ruby-forum.com/t/new-rails-app-is-not-working-i-am-missing-something/59815/13 "2006-05-09T16:12:44Z")

</div>

Wait!

Looking back now I see that when using webrick I indeed went to  
[example.com:3000/asset/admin](http://example.com:3000/asset/admin).

So I just tried it again, using webrick as the server, and the URL  
[www.example.com:3000/admin](http://www.example.com:3000/admin) and I get hte same error.

Application error

Change this error message for exceptions thrown outside of an action  
(like in Dispatcher setups or broken Ruby code) in public/500.html

Any ideas from here? What other info do you need?

---

<div class="post-metadata">

**Author:** ![nitefall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/76d3ee/32.png) [@nitefall](https://www.ruby-forum.com/u/nitefall)\
**Post date:** [May 9, 2006, 4:04pm UTC](https://www.ruby-forum.com/t/new-rails-app-is-not-working-i-am-missing-something/59815/14 "2006-05-09T16:04:58Z")

</div>

Ray B. wrote:

> If you want to access the url [http://www.example.com/asset/admin](http://www.example.com/asset/admin) as you  
> were doing in an earlier post then need an asset controller that  
> contains an admin action.
> 
> In that same post you said that you had created an admin controller, so  
> perhaps you need to create an asset action in that controller and access  
> the url [http://www.example.com/admin/asset](http://www.example.com/admin/asset).
> 
> –
> 
> Ray

The path to the application is [http://www.example.com/asset/](http://www.example.com/asset/)

In other words… /asset is aliased (in apache) to the ./public  
directory of the application.

When I used webbrick I used [http://www.example.com:3000/admin](http://www.example.com:3000/admin)

Admin is the controller, not asset.

Eitherway I get the issue of some files not being in the right place.

---

<div class="post-metadata">

**Author:** ![nitefall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/76d3ee/32.png) [@nitefall](https://www.ruby-forum.com/u/nitefall)\
**Post date:** [May 9, 2006, 4:59pm UTC](https://www.ruby-forum.com/t/new-rails-app-is-not-working-i-am-missing-something/59815/15 "2006-05-09T16:59:15Z")

</div>

Charlie B. wrote:

> What’s in your development\_log?

Recognition failed for “/asset”  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action\_controller/routing.rb:488:in  
`recognition_failed' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/routing.rb:478:in`recognize!’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb:38:in  
`dispatch' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/webrick_server.rb:115:in`handle\_dispatch’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/webrick\_server.rb:81:in  
`service' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in`service’  
/usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' /usr/local/lib/ruby/1.8/webrick/server.rb:155:in`start\_thread’  
/usr/local/lib/ruby/1.8/webrick/server.rb:144:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:144:in`start\_thread’  
/usr/local/lib/ruby/1.8/webrick/server.rb:94:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:89:in`each’  
/usr/local/lib/ruby/1.8/webrick/server.rb:89:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:79:in`start’  
/usr/local/lib/ruby/1.8/webrick/server.rb:79:in `start' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/webrick_server.rb:67:in`dispatch’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/commands/servers/webrick.rb:59  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:21:in  
`require__' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in`require’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active\_support/dependencies.rb:147:in  
`require' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/commands/server.rb:30 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in`require\_\_’  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:21:in  
`require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in`require’  
script/server:3

---

<div class="post-metadata">

**Author:** ![nitefall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/76d3ee/32.png) [@nitefall](https://www.ruby-forum.com/u/nitefall)\
**Post date:** [May 9, 2006, 7:16pm UTC](https://www.ruby-forum.com/t/new-rails-app-is-not-working-i-am-missing-something/59815/16 "2006-05-09T19:16:16Z")

</div>

whats in your config/routes.rb? It seems like rails doesn’t know how to  
map your url.

---

<div class="post-metadata">

**Author:** ![nitefall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/76d3ee/32.png) [@nitefall](https://www.ruby-forum.com/u/nitefall)\
**Post date:** [May 9, 2006, 4:17pm UTC](https://www.ruby-forum.com/t/new-rails-app-is-not-working-i-am-missing-something/59815/17 "2006-05-09T16:17:37Z")

</div>

What’s in your development\_log?

---

<div class="post-metadata">

**Author:** ![nitefall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/76d3ee/32.png) [@nitefall](https://www.ruby-forum.com/u/nitefall)\
**Post date:** [May 10, 2006, 5:14am UTC](https://www.ruby-forum.com/t/new-rails-app-is-not-working-i-am-missing-something/59815/18 "2006-05-10T05:14:56Z")

</div>

Charlie B. wrote:

> whats in your config/routes.rb? It seems like rails doesn’t know how to  
> map your url.

* * *

Here is my routes.rb file:

ActionController::Routing::Routes.draw do |map|

# The priority is based upon order of creation: first created -\>

highest priority.

# Sample of regular route:

# map.connect ‘products/:id’, :controller =\> ‘catalog’, :action =\>

‘view’

# Keep in mind you can assign values other than :controller and

:action

# Sample of named route:

# map.purchase ‘products/:id/purchase’, :controller =\> ‘catalog’,

:action =\> ‘purchase’

# This route can be invoked with purchase\_url(:id =\> product.id)

# You can have the root of your site routed by hooking up ‘’

# – just remember to delete public/index.html.

# map.connect ‘’, :controller =\> “welcome”

# Allow downloading Web Service WSDL as a file with an extension

# instead of a file named ‘wsdl’

map.connect ‘:controller/service.wsdl’, :action =\> ‘wsdl’

# Install the default route as the lowest priority.

map.connect ‘:controller/:action/:id’  
end

---

<div class="post-metadata">

**Author:** ![nitefall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/76d3ee/32.png) [@nitefall](https://www.ruby-forum.com/u/nitefall)\
**Post date:** [May 13, 2006, 12:26am UTC](https://www.ruby-forum.com/t/new-rails-app-is-not-working-i-am-missing-something/59815/19 "2006-05-13T00:26:27Z")

</div>

Really… I want to be using Apache…

What does the routes.rb file specify (routes clearly) Is it only for  
webrick?? Or does it effect Apache as well??

What can I do to get Apache to recognize these files??

Is something incorrect with the rewrite module?

Help ?!?!?!

Dave R. wrote:

> My email server is down, so by the time you get this, I’m sure you’ll  
> have  
> the answer. If not…
> 
> If you’re using webrick, the url will be /admin, not /asset/admin,  
> unless  
> you’ve put something in your routes.rb file to make recognize  
> /asset/admin.
> 
> Dave

---

<div class="post-metadata">

**Author:** ![nitefall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/76d3ee/32.png) [@nitefall](https://www.ruby-forum.com/u/nitefall)\
**Post date:** [May 13, 2006, 9:02am UTC](https://www.ruby-forum.com/t/new-rails-app-is-not-working-i-am-missing-something/59815/20 "2006-05-13T09:02:15Z")

</div>

OK

I deleted the application directory (/path/to/asset\_track/)

Re-created it (rails asset\_track)

set …/config/databse.yml correctly

Built the Admin Controller (ruby script/generate scaffold Asset Admin)

Started WebBrick and it seems to be working.

But it still is not working in Apache.

How can I get this working in Apache?

[Next page](https://www.ruby-forum.com/t/new-rails-app-is-not-working-i-am-missing-something/59815.md?page=2)
