Redmine 3.2 installation on Dreamhost
Added by Didjo - over 9 years ago
Hi!
Multiple ressources accross the web about Redmine on Dreamhost, but they're all quite outdated…
My issue here is that I manage to install the right versions of ruby, rails, etc. on Dreamhost (shared), and I got the "Rails application failed to start properly" error.
Apache errors logs are "Premature end of script headers: dispatch.fcgi", but result of a "ruby ./public/dispatch.fcgi" is only:
/home/my_username/.rvm/gems/ruby-2.2.4/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb:465: warning: duplicated key at line 466 ignored: "inodot"
And it does nothing, no return.
I first followed http://wiki.dreamhost.com/Redmine (and Redmine official installation process), and a lot of other ressources, that made me install and add "fcgi" to Gemfiles, tried to update htmlentities but rbpdf wasn't ok to use it
"RAILS_ENV=production script/about" says "No such file or directory"
"ruby ./script/about" says "script/about no longer exists, please use bin/about instead."
and "ruby ./bin/about" says:
/home/my_username/.rvm/gems/ruby-2.2.4/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb:465: warning: duplicated key at line 466 ignored: "inodot" sh: bzr: command not found Environment: Redmine version 3.2.1.stable Ruby version 2.2.4-p230 (2015-12-16) [x86_64-linux] Rails version 4.2.5.2 Environment production Database adapter Mysql2 SCM: Subversion 1.6.17 Darcs 2.7.99.1 Mercurial 2.0.2 Cvs 1.12.13 Git 1.7.9.5 Filesystem Redmine plugins: no plugin installed
/public/.htaccess:
<IfModule mod_fastcgi.c>
AddHandler fastcgi-script .fcgi
</IfModule>
<IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi
</IfModule>
Options +FollowSymLinks +ExecCGI
RewriteEngine On
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
<IfModule mod_fastcgi.c>
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
</IfModule>
<IfModule mod_fcgid.c>
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
</IfModule>
ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly."
/public/dispatch.fcgi:
#!/usr/bin/env ruby
ENV['RAILS_ENV'] = 'development'
ENV['HOME'] ||= `echo ~`.strip
ENV['GEM_HOME'] = '/home/my_username/.rvm/gems/ruby-2.2.4'
ENV['GEM_PATH'] = File.expand_path('~/.gems') + ":" + '/home/my_username/.rvm/gems/ruby-2.2.4'
require 'rubygems'
Gem.clear_paths
require 'fcgi'
require '/home/my_username/my_domain/config/boot'
require '/home/my_username/my_domain/config/environment'
class Rack::PathInfoRewriter
def initialize(app)
@app = app
end
def call(env)
env.delete('SCRIPT_NAME')
parts = env['REQUEST_URI'].split('?')
env['PATH_INFO'] = parts[0]
env['QUERY_STRING'] = parts[1].to_s
@app.call(env)
end
end
wrappedApp = Rack::Builder.new do
use Rack::ShowExceptions
use Rack::PathInfoRewriter
run RedmineApp::Application
end
Rack::Handler::FastCGI.run wrappedApp
Added a /Gemfile.local with:
# Gemfile.local gem 'fcgi'
I double checked database infos, and I don't know know where to look at.
Any help really appreciated!
Thanks