No route found to match - Routing Error on Dreamhost

I am really sorry to be asking this question, since I know it’s been
asked before many times (and I’ve been googling for it). And it’s a
basic problem which I wouldn’t be asking for help for if I hadn’t been
put me at a standstill for the last two days.

Basically, I’ve started a RoR project on Dreamhost, and I can’t even
get a “Hello World” controller to work. Instead I get:

“no route found to match “/MyTest/” with {:method=>:get}” (I created a
controller called MyTest to print “Hello World”)

The page in error is:
http://rails2.scoopytube.com/MyTest/

To show that my installation works, here’s the index welcome page:
http://rails2.scoopytube.com/

The only instructions I’ve followed were the very basic ones on the
Dreamhost wiki to get Rails working on a top-level of the subdomain:
http://wiki.dreamhost.com/Rails

I haven’t done any other kind of special step, whether it be altering
routes.db, the .htaccess file, etc (although I have done that with
OTHER attempts at RoR installations, all having failed). So
basically…what step am I missing besides running >rails
MyProjectName and getting at least the WElcome page to show up?

Don’t know what RoR version is being used specifically (they are in
the middle of rolling out the newest version) but the subdomain is
using FastCGI.

Here is what my .htaccess says:

General Apache options

AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI

RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]

In case Rails experiences terminal errors

Instead of displaying this message you can supply a file here which

will be rendered instead

Example:

ErrorDocument 500 /500.html

ErrorDocument 500 “

Application error

Rails application failed
to start properly”

you said, "(I created a controller called MyTest to print “Hello
World”) "

ok, so you must have a file called my_test_controller.rb in your ‘app/
controllers’ directory right? If so, you also need an ‘action’ and a
corresponding ‘view’. For example, put this in your
my_test_controller.rb:

def test
@greeting = ‘Hello World’
end

Then, create a file in your ‘app/views/my_test’ directory called
test.rhtml. In there, just put this:

<%= @greeting %>

…and then visit http://rails2.scoopytube.com/mytest/test to see the
greeting.

???

I created that controller as “MyTest” (following instructions from
onlamp, which uses the address “MyTest” in its example)…did
something change in recent versions of Rails where the address of a
controller is meant to be in lowercase?

I guess that makes sense, though…seeing how the file itself is named
“my_test_controller.rb”…thanks for the help, I knew it was a stupid
and simple error I was making.

Hello all,

Im also getting the same “No route matches “/my_test” with
{:method=>:get}” error. I have tried MyTest, My_Test, mytest, my_test
but nothing works. Any help in this regard will be appreciated. The
builtin webserver webrick is running but I cant get the MyTest
application running. (I also followed the application creation process
from OnLamp). Could you please also email me at [email protected]

Regards,
Haris G.

scratch all that crap I just wrote. You just had your URL wrong.
Look here => http://rails2.scoopytube.com/my_test/

Haris G. wrote:

Hello all,

Im also getting the same “No route matches “/my_test” with
{:method=>:get}” error. I have tried MyTest, My_Test, mytest, my_test
but nothing works. Any help in this regard will be appreciated. The
builtin webserver webrick is running but I cant get the MyTest
application running. (I also followed the application creation process
from OnLamp). Could you please also email me at [email protected]

Regards,
Haris G.

Which Ide u r using?
after seeing ur message, i just crated a project named “Dreamhost”
and controller under app/controllers named “my_test_controller.rb”,
defined a method -->

def test
@greeting = “HelloWorld”
end

and created a view under app/views/my_test -> named “test.rhtml” .
iam using webrick server.
i can able to find the output “HelloWorld” on browser.
then why don’t u get the same thing at ur end.

??? is this really a doubt or just for fun???
if its a fun, don’t do it again?

Hi,

I had same problem, after restart of Webrick server, everything is going
well.

DC wrote:

I am really sorry to be asking this question, since I know it’s been
asked before many times (and I’ve been googling for it). And it’s a
basic problem which I wouldn’t be asking for help for if I hadn’t been
put me at a standstill for the last two days.

Basically, I’ve started a RoR project on Dreamhost, and I can’t even
get a “Hello World” controller to work. Instead I get:

“no route found to match “/MyTest/” with {:method=>:get}” (I created a
controller called MyTest to print “Hello World”)

I could solve the issue by restarting my Webrick server.

DC wrote:

???

I created that controller as “MyTest” (following instructions from
onlamp, which uses the address “MyTest” in its example)…did
something change in recent versions of Rails where the address of a
controller is meant to be in lowercase?

Apparently so. Current practice is that URLs are in underscore_case .
I thought it had always been this way; either I’m wrong or the tutorial
is.

I guess that makes sense, though…seeing how the file itself is named
“my_test_controller.rb”…thanks for the help, I knew it was a stupid
and simple error I was making.

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Would you mind providing your routes.rb config file?

Make sure controllers actions are not commented out
map.connect ‘:controller/:action/:id’

DC wrote:

I am really sorry to be asking this question, since I know it’s been
asked before many times (and I’ve been googling for it). And it’s a
basic problem which I wouldn’t be asking for help for if I hadn’t been
put me at a standstill for the last two days.

Basically, I’ve started a RoR project on Dreamhost, and I can’t even
get a “Hello World” controller to work. Instead I get:

“no route found to match “/MyTest/” with {:method=>:get}” (I created a
controller called MyTest to print “Hello World”)

I’m a newbie to Ruby/Rails as well. When I tried ‘my_test’ in the URL
(i.e. http://localhost:3000/my_test/index), and all permutations of it
thereafter, I still kept getting the ‘no route to found to match…’
error. However, there is a configuration in the routes.rb file that will
make these URLs work (apparently, since Rails 3, this is the
configuration to put in). Just insert the below configuration anywhere
in the routes.rb file

  match 'my_test/index' => 'my_test#index'

Restart Rails after this, and try the
http://localhost:3000/my_test/index URL again. Hopefully, that should do
it.

Good luck,
G.