Hi everybody.
I’m a newbie on RoR. I have some experiencie developing in PHP or Java,
but I’m just starting with RoR.
A few days ago I signed up to the (gs) Grid Service on Media Temple.
This is my very first experience deplying RoR on a production
enviroment. Until now I just used the WebRick server on developement.
Well, the problem I’m having is that after installing the ruby_gems,
rails, mysql and the mongrel gems as indicated on the knowledge base of
media temple without any problem
(http://kb.mediatemple.net/article.php?id=140 ).
I’ve created a new RoR application, created the simbolic link, and
generated the .htaccess file just like the article indicates.
You can see the welcome page at here http://www.realwebs.com.ar/
When I clicked the link on the welcome page to see details about the
enviroment, http://www.realwebs.com.ar/rails/info/properties , I just
get the Rails 404 Error message.
It didn’t worried me, because I thinked that it would be due to security
rectrictions or something like that.
Then I used the console to create a new controller called test with an
action on it called index.
script/generate controller test index
exists app/controllers/
exists app/helpers/
create app/views/test
exists test/functional/
create app/controllers/test_controller.rb
create test/functional/test_controller_test.rb
create app/helpers/test_helper.rb
create app/views/test/index.rhtml
When i try to reach that controller with the web browser I keep getting
the 404 message. (http://www.realwebs.com.ar/test )
I checked the mongrel logs, and I don’t know much about mongrel, but I
googled a little and everything seems to be right in the mongrel.log:
** Daemonized, any open files are closed. Look at log/mongrel.pid and
log/mongrel.log for info.
** Starting Mongrel listening at 0.0.0.0:2011
** Starting Rails with production environment…
** Rails loaded.
** Loading any Rails specific GemPlugins
** Signals ready. TERM => stop. USR2 => restart. INT => stop (no
restart).
** Rails signals registered. HUP => reload (without restart). It might
not work well.
** Mongrel available at 0.0.0.0:2011
** Writing PID file to log/mongrel.pid
Then, I checked the production.log, and here seems to be the problem,
because I think mongrel isn’t routing the parameters in the requests:
Processing ApplicationController#index (for 200.127.42.218 at 2007-06-13
20:45:11) [GET]
Session ID: b811f7fd246057501ceb8069f2cd58dc
Parameters: {}
ActionController::RoutingError (no route found to match “/test” with
{:method=>:get}):
/home/20062/data/rubygems/gems/gems/actionpack-1.13.3/lib/action_controller/routing.rb:1292:in
recognize_path' /home/20062/data/rubygems/gems/gems/actionpack-1.13.3/lib/action_controller/routing.rb:1282:in
recognize’
/home/20062/data/rubygems/gems/gems/rails-1.2.3/lib/dispatcher.rb:40:in
dispatch' /home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel/rails.rb:78:in
process’
/home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel/rails.rb:76:in
synchronize' /home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel/rails.rb:76:in
process’
/home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel.rb:618:in
process_client' /home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel.rb:617:in
each’
/home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel.rb:617:in
process_client' /home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel.rb:736:in
run’
/home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel.rb:736:in
initialize' /home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel.rb:736:in
new’
/home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel.rb:736:in
run' /home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel.rb:720:in
initialize’
/home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel.rb:720:in
new' /home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel.rb:720:in
run’
/home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel/configurator.rb:271:in
run' /home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel/configurator.rb:270:in
each’
/home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel/configurator.rb:270:in
run' /home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/bin/mongrel_rails:127:in
run’
/home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel/command.rb:211:in
run' /home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/bin/mongrel_rails:243 /home/20062/data/rubygems/gems/bin/mongrel_rails:16:in
load’
/home/20062/data/rubygems/gems/bin/mongrel_rails:16
Processing ApplicationController#index (for 200.127.42.218 at 2007-06-13
19:52:32) [GET]
Session ID: b811f7fd246057501ceb8069f2cd58dc
Parameters: {}
ActionController::RoutingError (no route found to match
“/rails/info/properties” with {:method=>:get}):
/home/20062/data/rubygems/gems/gems/actionpack-1.13.3/lib/action_controller/routing.rb:1292:in
recognize_path' /home/20062/data/rubygems/gems/gems/actionpack-1.13.3/lib/action_controller/routing.rb:1282:in
recognize’
/home/20062/data/rubygems/gems/gems/rails-1.2.3/lib/dispatcher.rb:40:in
dispatch' /home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel/rails.rb:78:in
process’
/home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel/rails.rb:76:in
synchronize' /home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel/rails.rb:76:in
process’
/home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel.rb:618:in
process_client' /home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel.rb:617:in
each’
/home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel.rb:617:in
process_client' /home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel.rb:736:in
run’
/home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel.rb:736:in
initialize' /home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel.rb:736:in
new’
/home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel.rb:736:in
run' /home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel.rb:720:in
initialize’
/home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel.rb:720:in
new' /home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel.rb:720:in
run’
/home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel/configurator.rb:271:in
run' /home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel/configurator.rb:270:in
each’
/home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel/configurator.rb:270:in
run' /home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/bin/mongrel_rails:127:in
run’
/home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/lib/mongrel/command.rb:211:in
run' /home/20062/data/rubygems/gems/gems/mongrel-1.0.1-i386-linux/bin/mongrel_rails:243 /home/20062/data/rubygems/gems/bin/mongrel_rails:16:in
load’
/home/20062/data/rubygems/gems/bin/mongrel_rails:16
I mean, every request receive empty parameters:
Processing ApplicationController#index (for 200.127.42.218 at 2007-06-13
20:45:11) [GET]
Session ID: b811f7fd246057501ceb8069f2cd58dc
Parameters: {}
ActionController::RoutingError (no route found to match “/test” with
{:method=>:get}):
But in the browser I put the name of the controller after the slash,
I.E.: http://www.realwebs.com.ar/test
Here is the .htaccess file:
General Apache options
AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI
If you don’t want Rails to look in certain directories,
use the following rewrite rules so that Apache won’t rewrite certain
requests
Example:
RewriteCond %{REQUEST_URI} ^/notrails.*
RewriteRule .* - [L]
Redirect all requests not available on the filesystem to Rails
By default the cgi dispatcher is used which is very slow
For better performance replace the dispatcher with the fastcgi one
Example:
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
RewriteEngine On
#MTSTART – Automatically generated, don’t modify –
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ http://10.2.134.220:2011/${escape:$1} [P]
#MTEND
If your Rails application is accessed via an Alias directive,
then you MUST also set the RewriteBase in this htaccess file.
Example:
Alias /myrailsapp /path/to/myrailsapp/public
RewriteBase /myrailsapp
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 tostart properly”
I think, that it seems to be right.
It would be any mongrel issue?
Please, could you give me a hand with this?
Thanks in advance, and sorry for my poor english.