Welcome Guest | Login

Rails application failed to start properly

Hi there,

===EDIT:===
It works now. I haven't changed anything lately... and all of the sudden it works. Even the error from "ruby dispatch.fcgi" is gone...
==========

I've been working on getting my application online for hours now, but it just won't work.

Yes,
I read the tutorial and went through several posts regarding this issue.

.htaccess
Those are my top lines:
# General Apache options
#AddHandler fastcgi-script .fcgi
#AddHandler cgi-script .cgi
AddHandler fcgid-script .fcgi
Options +FollowSymLinks +ExecCGI

The RewriteRules look like this:
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

dispatch.fcgi, dispatch.rb, dispatch.cgi
First line is: #!/usr/local/bin/ruby

database.yml
production:
adapter: mysql
database: USERNAME_DBNAME
username: USERNAME_USERNAME
password: PASSWORD

routes.rb
I uncommented this line:
map.root :controller => "welcome"
Where "welcome" is my main controller
and even addes this line:
map.connect '', :controller => "welcome"

environment.rb
I haven't changed anything besides uncommenting:
ENV['RAILS_ENV'] ||= 'production'
My RAILS_GEM_SERSION in here is set to '2.1.0'

I don't use any non standard plugins and therefor didn't freeze anything.

ruby dispatch.fcgi
This command brought up the following:
/usr/local/lib/ruby/1.8/yaml.rb:133:in `load': syntax error on line 1, col 9: `a' (ArgumentError)
       from /usr/local/lib/ruby/1.8/yaml.rb:133:in `load'
       from /usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:701:in `database_configuration'
       from /usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:331:in `initialize_database'
       from /usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:120:in `process'
       from /usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:93:in `send'
       from /usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:93:in `run'
       from ./../config/environment.rb:13
       from dispatch.fcgi:21:in `require'
       from dispatch.fcgi:21
But as far as I can tell, the two files 'dispatch-fcgi' and 'environment.rb' are allright.

My 'development.log' stays empty and the cPanel ErrorLog tells me:
[Sun Aug 24 05:35:46 2008] [notice] mod_fcgid: process /home/USERNAME/public_html/dispatch.fcgi(2165) exit(communication error), terminated by calling exit(), return code: 1

So what the hack am I missing here?

Thanks for any help on this.

Sietsch.

2008-08-24 04:38 AM

The issue has been fixed now. There were some additional space in your database.yml file and the database name you had given was incorrect. Also I have granted all privileges to the user of the database. Now your site is loading fine. Please verify it.

2008-08-24 05:03 AM

Regards,
Rahul
Hi Rahul,

thanks for your help.
The additional spaces, I understand. But the names inside the database.yml are still the once I put in.
But you're right, the site loads fine now. :-)


I don't know if this is the right place to ask, but I get an error 422 when I submit my login form of the starting page.
The log tells me "ActionController::InvalidAuthenticityToken".
While my site works fine on my local server, it doesn't online.

I uncommented the ":secret ..." in application.rb, but still not working.

Thanks.

2008-08-24 06:18 AM

Hi - Please try adding the following line in your controller.

---------------------------
protect_from_forgery :only => [:create, :update, :destroy]
---------------------------

2008-08-24 07:32 AM


Hello Guest! In order to post you must be an active client with us, please log in or sign up.