Answers:
在以下方面有很好的指南:
https://github.com/tecnh/gollum/wiki/Gollum-and-Passenger
要点如下:
#!/usr/bin/ruby
require 'rubygems'
require 'bundler/setup'
require 'gollum/frontend/app'
system("which git") or raise "Looks like I can't find the git CLI in your path.\nYour path is: #{ENV['PATH']}"
gollum_path = '/path/to/wiki' # CHANGE THIS TO POINT TO YOUR OWN WIKI REPO
disable :run
configure :development, :staging, :production do
set :raise_errors, true
set :show_exceptions, true
set :dump_errors, true
set :clean_trace, true
end
$path = gollum_path
Precious::App.set(:gollum_path, gollum_path)
Precious::App.set(:wiki_options, {})
run Precious::App
August Lilleaas的答案是正确的,但是我需要使用旧版本的gollum,因此我使用Bundler进行了设置:
Gemfile
:
source 'http://rubygems.org'
gem 'rdiscount'
gem 'gollum', '1.3.0'
config.ru
:
require 'rubygems'
require 'bundler'
Bundler.require
require "gollum/frontend/app"
Precious::App.set(:gollum_path, File.expand_path(File.dirname(__FILE__)))
Precious::App.set(:wiki_options, {})
run Precious::App
还记得创建目录public
和tmp
,因为Passenger需要这些目录。
但是,我遇到了另一个问题。您必须确保git
该路径在webserver-user的路径中。对我来说不是这种情况,不幸的是没有错误消息,您总是总是在页面上最终创建一个新页面。