我使用这个指南为用户gitlab (rvm ruby python)创建了ruby环境:http://wiki.gentoo.org/wiki/GitLab
cat /etc/init.d/gitlab
GITLAB_BASE=/home/gitlab/gitlab
GITLAB_USER=gitlab
depend() {
need net redis
}
start() {
ebegin "Starting gitlab unicorn server"
start-stop-daemon --start \
--chdir "${GITLAB_BASE}" \
--user "${GITLAB_USER}" \
--pidfile "${GITLAB_BASE}/tmp/pids/unicorn.pid" \
--exec bundle -- exec unicorn_rails -c "${GITLAB_BASE}/config/unicorn.rb" -E production -D
eend $?
ebegin "Starting gitlab sidekiq"
start-stop-daemon --start \
--chdir "${GITLAB_BASE}" \
--user "${GITLAB_USER}" \
--pidfile "${GITLAB_BASE}/tmp/pids/sidekiq.pid" \
--exec bundle -- exec rake sidekiq:start RAILS_ENV=production
eend $?
}
stop() {
ebegin "Stopping gitlab sidekiq"
start-stop-daemon --stop \
--chdir "${GITLAB_BASE}" \
--user "${GITLAB_USER}" \
--pidfile "${GITLAB_BASE}/tmp/pids/sidekiq.pid"
eend $?
ebegin "Stopping gitlab unicorn server"
start-stop-daemon --stop \
--chdir "${GITLAB_BASE}" \
--user "${GITLAB_USER}" \
--pidfile "${GITLAB_BASE}/tmp/pids/unicorn.pid"
eend $?
}% 当我开始它的时候,我看到:
* Starting gitlab unicorn server ...
* start-stop-daemon: bundle does not exist
* Starting gitlab sidekiq ...
* start-stop-daemon: bundle does not exist
* ERROR: gitlab failed to start我有用户gitlab的捆绑包。我哪里做错了?
发布于 2013-07-03 06:05:14
这里有两个问题。首先,rvm通常只由用户的shell加载,并且此处不会调用该shell。其次,bundle也不会在路径中。要解决这两个问题,假设这是针对每个用户的rvm安装,请尝试执行以下操作...
... --exec /home/gitlab/.rvm/bin/rvm -- default do bundle exec ...顺便说一下,你不应该在Rails3应用程序中使用unicorn_rails。只需使用普通的独角兽。
发布于 2013-07-04 20:20:46
另外,将GITLAB_BASE=/home/gitlab/gitlab更改为GITLAB_BASE=/home/git/gitlab。这个初始化脚本来自GitLab 4.2。从5.0开始,用户从gitlab改为git。
https://stackoverflow.com/questions/17435943
复制相似问题