Defect #10381

Redmine 1.3.1 does not start (new installation on Fedora 14)

Added by Ivan Smirnov over 7 years ago. Updated over 7 years ago.

Status:ClosedStart date:
Priority:UrgentDue date:
Assignee:-% Done:

0%

Category:-
Target version:-
Resolution:Invalid Affected version:1.3.1

Description

When I try to execute public/dispatch.cgi manually from console, I get this:
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/dispatcher.rb:24: warning: already initialized constant Dispatcher
/data/redmine/vendor/rails/actionpack/lib/action_controller/cgi_process.rb:22:in `__send__': undefined method `env_table' for nil:NilClass (NoMethodError)
from /data/redmine/vendor/rails/actionpack/lib/action_controller/cgi_process.rb:22:in `dispatch_cgi'
from /data/redmine/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:101:in `dispatch_cgi'
from /data/redmine/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:27:in `dispatch'
from public/dispatch.cgi:10

When I try to load Redmine page I get server timeout. And nothing appears in Apache`s logs nor in Redmine`s log/production.log.

Webrick server works fine.

Here is the output of RAILS_ENV=production script/about:
About your application's environment
Ruby version 1.8.7 (x86_64-linux)
RubyGems version 1.3.7
Rack version 1.1
Rails version 2.3.14
Active Record version 2.3.14
Active Resource version 2.3.14
Action Mailer version 2.3.14
Active Support version 2.3.14
Edge Rails revision unknown
Application root /data/redmine
Environment production
Database adapter postgresql
Database schema version 20110902000000

Apache version is 2.2.17.

environment.rb Magnifier (2.56 KB) Ivan Smirnov, 2012-03-06 11:39

History

#1 Updated by Etienne Massip over 7 years ago

  • Status changed from New to Closed
  • Resolution set to Invalid

As you can see from the stack trace, you're running rails 2.3.5:

/usr/lib/ruby/gems/1.8/gems/rails- 2.3.5/lib/dispatcher.rb:24

Remove the vendored rails 2.3.5 directory from your redmine/vendor.

#2 Updated by Ivan Smirnov over 7 years ago

Etienne Massip wrote:

As you can see from the stack trace, you're running rails 2.3.5:

/usr/lib/ruby/gems/1.8/gems/rails- 2.3.5/lib/dispatcher.rb:24

Remove the vendored rails 2.3.5 directory from your redmine/vendor.

Thank you for quick answer!
What directory exactly should I remove? redmine/vendor/rails?
In that case (I made a backup and removed redmine/vendor/rails), dispatch.cgi outputs this:
/usr/lib/ruby/site_ruby/1.8/rubygems.rb:779:in `report_activate_error': RubyGem version error: rails(2.3.5 not = 2.3.14) (Gem::LoadError)
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:214:in `activate'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:1082:in `gem'
from ./../config/boot.rb:65:in `load_rails_gem'
from ./../config/boot.rb:59:in `load_initializer'
from ./../config/boot.rb:43:in `run'
from ./../config/boot.rb:16:in `boot!'
from ./../config/boot.rb:119
from ./../config/environment.rb:15:in `require'
from ./../config/environment.rb:15
from ./dispatch.cgi:3:in `require'
from ./dispatch.cgi:3

#3 Updated by Etienne Massip over 7 years ago

Look at your config/environment.rb.

I don't know how you did your upgrade but I doubt that you followed RedmineUpgrade instructions =)

#4 Updated by Ivan Smirnov over 7 years ago

Etienne Massip wrote:

Look at your config/environment.rb.

I don't know how you made your upgrade but I doubt that you followed RedmineUpgrade instructions =)

It was fresh install, but it hasn't worked straight. I've followed the install manual but maybe I've done something wrong =) Anyway, I highly appreciate your help.

Here, in the attachement, is my config/environment.rb. In this file I've uncommented the line:
ENV['RAILS_ENV'] ||= 'production'
And, as I remember, it was the only change I've made to this file.

#5 Updated by Etienne Massip over 7 years ago

What's the Rails version mentioned in your environment.rb file?

#6 Updated by Ivan Smirnov over 7 years ago

Etienne Massip wrote:

What's the Rails version mentioned in your environment.rb file?

RAILS_GEM_VERSION = '2.3.14' unless defined? RAILS_GEM_VERSION

#7 Updated by Etienne Massip over 7 years ago

My bad, I just reversed my reading, sorry.

The vendor/rails was fine, the issue must be in you dispatch.cgi/.fcgi which should point to your vendor/rails dispatcher.

#8 Updated by Ivan Smirnov over 7 years ago

Etienne Massip wrote:

My bad, I just reversed my reading, sorry.

The vendor/rails was fine, the issue must be in you dispatch.cgi/.fcgi which should point to your vendor/rails dispatcher.

OK. So have restored vendor/rails directory and changed public/dispatch.cgi.
Old line:
require "/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/dispatcher.rb"
New line:
require "/data/redmine/vendor/rails/railties/lib/dispatcher.rb"

And new output of public/dispatch.cgi is this:
/data/redmine/vendor/rails/railties/lib/dispatcher.rb:24: warning: already initialized constant Dispatcher
/data/redmine/vendor/rails/actionpack/lib/action_controller/cgi_process.rb:22:in `__send__': undefined method `env_table' for nil:NilClass (NoMethodError)
from /data/redmine/vendor/rails/actionpack/lib/action_controller/cgi_process.rb:22:in `dispatch_cgi'
from /data/redmine/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:101:in `dispatch_cgi'
from /data/redmine/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:27:in `dispatch'
from ./dispatch.cgi:11

#9 Updated by Etienne Massip over 7 years ago

Ok, and now I remember that Rails is no more supporting cgi, there is an issue roaming treating this topic: #4610.

My advice is to go for fcgi which is waaaay faster (cgi is a pain to use with Rails).

#10 Updated by Ivan Smirnov over 7 years ago

Etienne Massip wrote:

Ok, and now I remember that Rails is no more supporting cgi, there is an issue roaming treating this topic: #4610.

My advice is to go for fcgi which is waaaay faster (cgi is a pain to use with Rails).

I removed dispatch.cgi and copied dispatch.fcgi.example to dispatch.fcgi.

Output of dispatch.fcgi in console is:
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- fcgi (MissingSourceFile)
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /data/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:184:in `require'
from /data/redmine/vendor/rails/railties/lib/fcgi_handler.rb:1
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /data/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:184:in `require'
from ./dispatch.fcgi:22

And Redmine web page still does not work.

#11 Updated by Etienne Massip over 7 years ago

You need fcgi gem.

#12 Updated by Tobias Fischer over 7 years ago

I had a similar problem after upgrading to 1.4.1 from 1.3.3 and I already had "fcgi" gem installed.
Nevertheless, Redmine came up with an internal server error.

While I didn't need the "libfcgi-ruby1.8" package for v1.3.3, installing it brought Redmine back online:

aptitude install libfcgi-ruby1.8

Also available in: Atom PDF