# Get error message

**URL:** <https://www.ruby-forum.com/t/get-error-message/111612>\
**Category:** Rails\
**Created:** [August 9, 2007, 4:09am UTC](https://www.ruby-forum.com/t/get-error-message/111612 "2007-08-09T04:09:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![snantz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c2a13f/32.png) [@snantz](https://www.ruby-forum.com/u/snantz)\
**Post date:** [August 9, 2007, 4:09am UTC](https://www.ruby-forum.com/t/get-error-message/111612/1 "2007-08-09T04:09:08Z")

</div>

I have been programming in RoR for about 2 months now, but the projects  
that I have started I have aloways started in the middle, so I have  
never built anything from the ground up. I’m now trying to start from  
the beginning and am getting a strange error message when trying to load  
the first page:

no route found to match “/music/index.rhtml” with {:method=\>:get}

Now, there is a method for index but it just redirect\_to another method  
and page. This should be working but I;m wondering if I don’t have some  
strange configuration issue somewhere? Thanks in advance,

-S

---

<div class="post-metadata">

**Author:** ![snantz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c2a13f/32.png) [@snantz](https://www.ruby-forum.com/u/snantz)\
**Post date:** [August 9, 2007, 4:34am UTC](https://www.ruby-forum.com/t/get-error-message/111612/2 "2007-08-09T04:34:54Z")

</div>

what does your redirect\_to line look like? And is this in your  
music\_controller?

Adam

---

<div class="post-metadata">

**Author:** ![snantz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c2a13f/32.png) [@snantz](https://www.ruby-forum.com/u/snantz)\
**Post date:** [August 9, 2007, 4:49am UTC](https://www.ruby-forum.com/t/get-error-message/111612/3 "2007-08-09T04:49:11Z")

</div>

Adam C. wrote:

> what does your redirect\_to line look like? And is this in your  
> music\_controller?
> 
> Adam

it just says:

redirect\_to :action =\> ‘welcome’

and yes, it is in the music\_controller.

---

<div class="post-metadata">

**Author:** ![snantz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c2a13f/32.png) [@snantz](https://www.ruby-forum.com/u/snantz)\
**Post date:** [August 9, 2007, 9:56am UTC](https://www.ruby-forum.com/t/get-error-message/111612/4 "2007-08-09T09:56:55Z")

</div>

Shandy N. wrote:

> Adam C. wrote:
> 
> > what does your redirect\_to line look like? And is this in your  
> > music\_controller?
> > 
> > Adam
> 
> it just says:
> 
> redirect\_to :action =\> ‘welcome’
> 
> and yes, it is in the music\_controller.

what do you have in your  
config/routes.rb file?

---

<div class="post-metadata">

**Author:** ![snantz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c2a13f/32.png) [@snantz](https://www.ruby-forum.com/u/snantz)\
**Post date:** [August 9, 2007, 3:59pm UTC](https://www.ruby-forum.com/t/get-error-message/111612/5 "2007-08-09T15:59:54Z")

</div>

> map.connect ‘:controller/:action/:id’ and a couple others.

the order of the routes that you put there could be causing a mess (if  
you are asking about configuration issues that has to do with routing,  
it would be in this file; therefore, this may be the problem.) - make  
sure the settings are in the correct order: the routes that appear on  
the top are higher precedence than the ones at the bottom. (even if you  
know this, it can be confusing, and this could be a problem of a route  
‘overwriting’ a different one.)

aside from that, just at looking at the error

> > no route found to match “/music/index.rhtml” with {:method=\>:get}

is a little odd; is the url you are directing to end with “…rhtml” ?  
if you were just plain redirecting to :action =\> :music, it would error  
out like

> no route found to match “/music/index”

anyway.

---

<div class="post-metadata">

**Author:** ![snantz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c2a13f/32.png) [@snantz](https://www.ruby-forum.com/u/snantz)\
**Post date:** [August 9, 2007, 6:37pm UTC](https://www.ruby-forum.com/t/get-error-message/111612/6 "2007-08-09T18:37:10Z")

</div>

Shai R. wrote:

> > map.connect ‘:controller/:action/:id’ and a couple others.
> 
> the order of the routes that you put there could be causing a mess (if  
> you are asking about configuration issues that has to do with routing,  
> it would be in this file; therefore, this may be the problem.) - make  
> sure the settings are in the correct order: the routes that appear on  
> the top are higher precedence than the ones at the bottom. (even if you  
> know this, it can be confusing, and this could be a problem of a route  
> ‘overwriting’ a different one.)
> 
> aside from that, just at looking at the error
> 
> > > no route found to match “/music/index.rhtml” with {:method=\>:get}
> 
> is a little odd; is the url you are directing to end with “…rhtml” ?  
> if you were just plain redirecting to :action =\> :music, it would error  
> out like
> 
> > no route found to match “/music/index”
> 
> anyway.

The redirect does end in .rhtml but in my controller I am saying  
redirect\_to :action =\> 'welcome"

I have tried it with just putting a simple “Hello World” for the index  
page and that works. Its just when I try and redirect from the index  
method to my welcome page do I get this error. Thanks,

~S

---

<div class="post-metadata">

**Author:** ![snantz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c2a13f/32.png) [@snantz](https://www.ruby-forum.com/u/snantz)\
**Post date:** [August 9, 2007, 3:25pm UTC](https://www.ruby-forum.com/t/get-error-message/111612/7 "2007-08-09T15:25:11Z")

</div>

Shai R. wrote:

> Shandy N. wrote:
> 
> > Adam C. wrote:
> > 
> > > what does your redirect\_to line look like? And is this in your  
> > > music\_controller?
> > > 
> > > Adam
> > 
> > it just says:
> > 
> > redirect\_to :action =\> ‘welcome’
> > 
> > and yes, it is in the music\_controller.
> 
> what do you have in your  
> config/routes.rb file?

It’s just the standard routes:

map.connect ‘:controller/:action/:id’ and a couple others.
