Error! Ruby on Rails based on FastCGI, Hello world !

Hey, I try to do my first steps in Ruby, and designed an "Hello World!" Application. Now I want to install this Application on an Apache server.

I copied it to the "/public_html/" Directory here: (the application is called "rubyapp") http://sn00p.profusehost.net/rubyapp/

I ran http://sn00p.profusehost.net/rubyapp/public/dispatch.fcgi and get an Error. So I looked it up in the logs and get the following

no route found to match "/dispatch.fcgi" with {:method=>:get} /home/sn00p/public_html/rubyapp/public/../config/../vendor/rails/actionpack/lib/action_controller/routing.rb:1292:in `recognize_path' /home/sn00p/public_html/rubyapp/public/../config/../vendor/rails/actionpack/lib/action_controller/routing.rb:1282:in `recognize' /home/sn00p/public_html/rubyapp/public/../config/../vendor/rails/railties/lib/dispatcher.rb:40:in `dispatch' /home/sn00p/public_html/rubyapp/public/../config/../vendor/rails/railties/lib/fcgi_handler.rb:168:in `process_request' /home/sn00p/public_html/rubyapp/public/../config/../vendor/rails/railties/lib/fcgi_handler.rb:143:in `process_each_request!' /home/sn00p/public_html/rubyapp/public/../config/../vendor/rails/railties/lib/fcgi_handler.rb:109:in `with_signal_handler' /home/sn00p/public_html/rubyapp/public/../config/../vendor/rails/railties/lib/fcgi_handler.rb:142:in `process_each_request!' /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:612:in `each_cgi' /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in `each' /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in `each_cgi' /home/sn00p/public_html/rubyapp/public/../config/../vendor/rails/railties/lib/fcgi_handler.rb:141:in `process_each_request!' /home/sn00p/public_html/rubyapp/public/../config/../vendor/rails/railties/lib/fcgi_handler.rb:55:in `process!' /home/sn00p/public_html/rubyapp/public/../config/../vendor/rails/railties/lib/fcgi_handler.rb:25:in `process!' /home/sn00p/public_html/rubyapp/public/dispatch.fcgi:26

Can you please help me, I am not familiar with this kind of log I do not understand what to do.

Regrades Snoop1990

I try to do my first steps in Ruby, and designed an "Hello World!" Application. Now I want to install this Application on an Apache server.

The Application runs on webrick (the internal web server) quiet well. There is no database connected or so!

dispatch.fcgi is used internally to pass information to RailsFCGIHandler. You dont have to worry about this.

Just call your application with the controller and actionname, that should just work as you do with webrick, for e.g. if you have a controller called hello and action called sayHello, http://sn00p.profusehost.net/rubyapp/hello/sayHello should just work.

The error that you get is because Rails' routes is not able to match any path for the URL you submitted.

Sorry i do not get this clearly !

This is my controllers directory: http://sn00p.profusehost.net/rubyapp/app/controllers/

rubyapp_controller.rb contains the index action

class RubyappController < ApplicationController   def index     render :text=> "Hello World!"   end end

So I tried http://sn00p.profusehost.net/rubyapp/rubyappcontroller/index and get (Error 404 not found), because apache tries to open the path like folders, but there are not folders.

I'm not sure, but I thought I have to run http://sn00p.profusehost.net/rubyapp/public/dispatch.fcgi to start the application.

Sorry i do not get this clearly !

This is my controllers directory: http://sn00p.profusehost.net/rubyapp/app/controllers/

rubyapp_controller.rb contains the index action

class RubyappController < ApplicationController def index    render :text=> "Hello World!" end end

So I tried http://sn00p.profusehost.net/rubyapp/rubyappcontroller/ index and get (Error 404 not found), because apache tries to open the path like folders, but there are not folders.

'controller' is not part of the url, so you'd wan http://sn00p.profusehost.net/rubyapp/rubyapp/index

I'm not sure, but I thought I have to run http://sn00p.profusehost.net/rubyapp/public/dispatch.fcgi to start
the application.

You don't. Apache invokes that for you

Fred

'controller' is not part of the url, so you'd wan http://sn00p.profusehost.net/rubyapp/rubyapp/index

Error 404: File not found!

'controller' is not part of the url, so you'd wan http://sn00p.profusehost.net/rubyapp/rubyapp/index

Error 404: File not found!

Have you told apache that http://sn00p.profusehost.net/rubyapp/public
should be the DocumentRoot ?

Fred

Frederick Cheung wrote: