I''m very new to Ruby and RoR, have been trying to get it working with no success. I''m on Ubuntu, installed Rails correctly, run scripts for model, controller and scaffold no problem, installed fcgi which now appear in apache header. When I point browser to http://localhost/tada/public/category I get: Not Found The requested URL /tada/public/category was not found on this server. Apache/2.0.53 (Ubuntu) mod_fastcgi/2.4.2 PHP/4.3.10-10ubuntu4 mod_ruby/1.2.4 Ruby/1.8.2(2004-12-23) Server at localhost Port 80 I think I am missing something in my apache.conf, I''ve added line: AddHandler fcgid-script .fcgi but still does not work. What else I need to do Thanks Shreko
Mark Reginald James
2005-Aug-11 06:48 UTC
Re: Need just a little help to start a rails app
Did you add a DocumentRoot directive? -- I develop, watch me RoR, in numbers too big to ignore.
Hi Shreko, First you can locally test your application using webrick. Just go to the rails directory type ruby script\server and it will start the webrick server which normally uses port 3000. Then open a browser and type http://localhost:3000/tada (if you have a controller or a view named Tada) or type http://localhost:3000/<yourcontrollername> it should show you the scaffold directly. Vikrant shreko wrote:> I''m very new to Ruby and RoR, have been trying to get it working with no > success. I''m on Ubuntu, installed Rails correctly, run scripts for model, > controller and scaffold no problem, installed fcgi which now appear in apache > header. When I point browser to http://localhost/tada/public/category I get: > Not Found > The requested URL /tada/public/category was not found on this server. > Apache/2.0.53 (Ubuntu) mod_fastcgi/2.4.2 PHP/4.3.10-10ubuntu4 mod_ruby/1.2.4 > Ruby/1.8.2(2004-12-23) Server at localhost Port 80 > > I think I am missing something in my apache.conf, I''ve added line: > AddHandler fcgid-script .fcgi > but still does not work. What else I need to do > > Thanks > > Shreko
Mark Reginald James
2005-Aug-11 07:02 UTC
Re: Need just a little help to start a rails app
To be more specific, set DocumentRoot to the full path to the "public" subdirectory of your Rails app, then point your browser to http://localhost/tada/[controller]/[action] , or just http://localhost/tada/[controller] for the index action. -- I develop, watch me RoR, in numbers too big to ignore.
shreko <beltspeed@...> writes: Thanks guys for your help. I did get it working with webrick, but I would still like to see how it runs under apache-fcgi. For starter, webrick will be OK. Now on suggestion to set DocumentRoot to public dir of my tada app. If currently my DocumentRoot is /var/www and I switch it to /var/www/tada/public what about my existing php apps that are in /var/www? Thanks, Shreko
Mark Reginald James
2005-Aug-11 14:31 UTC
Re: Need just a little help to start a rails app
Shreko wrote:> Now on suggestion to set DocumentRoot to public dir of my tada app. If currently > my DocumentRoot is /var/www and I switch it to /var/www/tada/public what about > my existing php apps that are in /var/www?Access your rails app via another host name alised to localhost, and set up Apache name-based hosting on this name using the rails DocumentRoot. -- We develop, watch us RoR, in numbers too big to ignore.
on 8/11/2005 7:31 AM Mark Reginald James said the following:> Shreko wrote: > >> Now on suggestion to set DocumentRoot to public dir of my tada app. >> If currently >> my DocumentRoot is /var/www and I switch it to /var/www/tada/public >> what about >> my existing php apps that are in /var/www? > > > Access your rails app via another host name alised to localhost, and > set up > Apache name-based hosting on this name using the rails DocumentRoot.Don''t change the document root unless you are only running a single rails application on the domain.. You could use a subdomain, but it is easier to use an Alias directive and the same host. Alias /tada/ /var/www/tada/public Points any hits on http://www.example.com/tada/ will to the corresponding files in /var/www/tada/public/ In the example that Shreko gave, DocumentRoot /var/www, means that http://www.example.com/tada/public is accessible. Was that a typo for /var/www/html? Ray