Project

General

Profile

Continuing the problems - Application error Rails application failed to start properly

Added by Eren Canpolat about 9 years ago

Hello,

I benefit from the links below. What I did was to no avail. I'm about to go crazy. Please somebody help me. If you want more information, I find.

I'm searcing for days.. But I could not find anything. Anyone experienced the same problem.. But I could not find anything. Anyone experienced the same problem.

http://www.redmine.org/projects/redmine/wiki/HowTo_install_Redmine_on_CentOS_5
http://www.redmine.org/projects/redmine/wiki/HowTo_configure_Apache_to_run_Redmine
http://sourceforge.net/projects/redsf/files/redmine-1.3.2.tar.gz/download ## download redmine

[root@myserver redmine]# cat /etc/redhat-release
CentOS release 5.11 (Final)

[root@myserver redmine]# uname -a
Linux myserver.example.com 3.16.7-x86_64-linode49 #3 SMP Fri Nov 14 16:55:37 EST 2014 x86_64 x86_64 x86_64 GNU/Linux

[root@myserver redmine]# mysql -V
mysql Ver 14.12 Distrib 5.0.95, for redhat-linux-gnu (x86_64) using readline 5.1

[root@myserver redmine]# httpd -V
Server version: Apache/2.2.3
Server built: Sep 16 2014 11:05:09
Server's Module Magic Number: 20051115:3
Server loaded: APR 1.2.7, APR-Util 1.2.7
Compiled using: APR 1.2.7, APR-Util 1.2.7
Architecture: 64-bit
Server MPM: Prefork
threaded: no
forked: yes (variable process count)

[root@myserver redmine]# ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [x86_64-linux]
[root@myserver redmine]# whereis ruby
ruby: /usr/bin/ruby /usr/local/bin/ruby /usr/local/lib/ruby
[root@myserver redmine]# which ruby

[root@myserver redmine]# gem -v
1.4.2
[root@myserver redmine]# whereis gem
gem: /usr/local/bin/gem
[root@myserver redmine]# which gem
/usr/local/bin/gem

[root@myserver redmine]# gem list --local
@
  • LOCAL GEMS ***

bundler (1.7.11)
coderay (0.9.8)
daemon_controller (1.2.0)
hoe (3.13.0)
i18n (0.4.2)
mysql (2.9.1)
passenger (4.0.57)
rack (1.6.0, 1.1.0)
rake (10.4.2, 0.8.3)
RedCloth (4.2.9)
rubytree (0.5.2)
@

[root@myserver redmine]# ls /etc/httpd/modules/
libphp5.so mod_authn_dbm.so mod_authz_user.so mod_deflate.so mod_filter.so mod_logio.so mod_proxy_ftp.so mod_status.so
mod_actions.so mod_authn_default.so mod_autoindex.so mod_dir.so mod_headers.so mod_mem_cache.so mod_proxy_http.so mod_substitute.so
mod_alias.so mod_authn_file.so mod_cache.so mod_disk_cache.so mod_ident.so mod_mime_magic.so mod_proxy.so mod_suexec.so
mod_asis.so mod_authnz_ldap.so mod_cern_meta.so mod_dumpio.so mod_imagemap.so mod_mime.so mod_python.so mod_unique_id.so
mod_auth_basic.so mod_authz_dbm.so mod_cgid.so mod_env.so mod_include.so mod_negotiation.so mod_reqtimeout.so mod_userdir.so
mod_auth_digest.so mod_authz_default.so mod_cgi.so mod_expires.so mod_info.so mod_perl.so mod_rewrite.so mod_usertrack.so
mod_authn_alias.so mod_authz_groupfile.so mod_dav_fs.so mod_ext_filter.so mod_ldap.so mod_proxy_ajp.so mod_setenvif.so mod_version.so
mod_authn_anon.so mod_authz_host.so mod_dav.so mod_fastcgi.so mod_log_config.so mod_proxy_balancer.so mod_speling.so mod_vhost_alias.so
mod_authn_dbd.so mod_authz_owner.so mod_dbd.so mod_file_cache.so mod_log_forensic.so mod_proxy_connect.so mod_ssl.so

[root@myserver redmine]# ruby script/about
About your application's environment
Ruby version 1.8.7 (x86_64-linux)
RubyGems version 1.4.2
Rack version 1.1
Rails version 2.3.14
Active Record version 2.3.14
Active Resource version 2.3.14
Action myserverer version 2.3.14
Active Support version 2.3.14
Edge Rails revision unknown
Application root /var/www/redmine
Environment development
Database adapter mysql
Database schema version 20110902000000

I tried all the options here.

[root@myserver redmine]# cat public/.htaccess
@# General Apache options
<IfModule mod_fastcgi.c>
  1. AddHandler fastcgi-script .fcgi
    </IfModule>
    <IfModule mod_fcgid.c>
  2. AddHandler fcgid-script .fcgi
    </IfModule>
    <IfModule mod_cgi.c>
    AddHandler cgi-script .cgi
    </IfModule>
    Options +FollowSymLinks +ExecCGI

RewriteEngine On
RewriteRule $ index.html [QSA]
RewriteRule ^([
.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f

<IfModule mod_fastcgi.c>
  1. RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
    </IfModule>
    <IfModule mod_fcgid.c>
  2. RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
    </IfModule>
    <IfModule mod_cgi.c>
    RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
    </IfModule>
  1. In case Rails experiences terminal errors
  2. Instead of displaying this message you can supply a file here which will be rendered instead #
  3. Example:
  4. ErrorDocument 500 /500.html

ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"@

[root@myserver redmine]# cat Gemfile
# file: /var/www/redmine/Gemfile
source "http://rubygems.org"
gem "rake", "0.8.3"
gem "rack", "1.1.0"
gem "i18n", "0.4.2"
gem "rubytree", "0.5.2", :require => "tree"
gem "RedCloth", "~>4.2.3", :require => "redcloth" # for CodeRay
gem "mysql"
gem "coderay", "~>0.9.7"

[root@myserver www]# cat /etc/httpd/conf/httpd.conf
<VirtualHost *:80>
ServerName redmine.example.com
ServerAdmin admin@example.com
DocumentRoot /var/www/redmine/public/
ServerAlias redmine.example.com
<Directory "/var/www/redmine/public/">
Options Indexes ExecCGI FollowSymLinks
Order allow,deny
Allow from all
AllowOverride all
</Directory>
</VirtualHost>

Httpd error.log,

[Thu Jan 08 13:43:14 2015] [error] [client 212.252.35.155] /var/www/redmine/vendor/rails/actionpack/lib/action_controller/cgi_process.rb:22:in `__send__'
[Thu Jan 08 13:43:14 2015] [error] [client 212.252.35.155] :
[Thu Jan 08 13:43:14 2015] [error] [client 212.252.35.155] undefined method `env_table' for nil:NilClass
[Thu Jan 08 13:43:14 2015] [error] [client 212.252.35.155] (
[Thu Jan 08 13:43:14 2015] [error] [client 212.252.35.155] NoMethodError
[Thu Jan 08 13:43:14 2015] [error] [client 212.252.35.155] )
[Thu Jan 08 13:43:14 2015] [error] [client 212.252.35.155] \tfrom /var/www/redmine/vendor/rails/actionpack/lib/action_controller/cgi_process.rb:22:in `dispatch_cgi'
[Thu Jan 08 13:43:14 2015] [error] [client 212.252.35.155] \tfrom /var/www/redmine/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:101:in `dispatch_cgi'
[Thu Jan 08 13:43:14 2015] [error] [client 212.252.35.155] \tfrom /var/www/redmine/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:27:in `dispatch'
[Thu Jan 08 13:43:14 2015] [error] [client 212.252.35.155] \tfrom /var/www/redmine/public/dispatch.cgi:11
[Thu Jan 08 13:43:14 2015] [error] [client 212.252.35.155] Premature end of script headers: dispatch.cgi


Replies (1)

RE: Continuing the problems - Application error Rails application failed to start properly - Added by Mischa The Evil about 9 years ago

Hello Eren,

I strongly recommend against using either of these referenced howto's1 as a base for installing a fresh Redmine instance nowadays. They are outdated, confusing or just plain wrong.

Make sure you only install a supported Redmine version (currently either 2.5.3 or 2.6.0) on a supported CentOS box (currently 6.6 or 7.0), whatever howto you are following. Also, be aware of the fact that almost all howto's describe one specific way of getting an (old) Redmine instance up and running, while there are almost always other ways to achieve to same thing (think about using different servers, application-servers, rubies, proxies, loadbalancers etc.). Be sure you understand what you're doing (and what your alternatives are) while you are following the steps given in a howto.

The only more recent and decent howtos for CentOS I could find are Redmine_203_with_Subversion_and_LDAP_Authentication_(for_Redmine_and_Subversion_through_Redmine)_on_Centos_6_i386_-_detailed and Install_Redmine_25x_on_Centos_65_complete. But those have some specific assumptions and specific requirements that you might not need or want and they are also slightly outdated (Redmine 2.0.3 and 2.5.0, which are not supported anymore).

Kind regards,

Mischa.

Edit by Mischa: added second howto which is recent and decent.

1 HowTo_install_Redmine_on_CentOS_5 and HowTo_configure_Apache_to_run_Redmine

    (1-1/1)