准备一台装有 Ubuntu 22.04 系统的服务器/虚拟机

服务器基础准备工作

sudo apt-get install -y build-essential git-core subversion bison openssl libreadline6-dev curl zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3  autoconf libc6-dev libpcre3-dev curl libcurl4-nss-dev libxml2-dev libxslt-dev imagemagick nodejs libffi-dev

安装 Ruby

bash -c "$(curl -fsSL https://gitee.com/RubyMetric/rbenv-cn/raw/main/tools/install.sh)"
source ~/.bashrc
rbenv cninstall 3.1.4
rbenv rehash
rbenv global 3.1.4

安装 MySQL

sudo apt-get install -y mysql-common mysql-client libmysqlclient-dev mysql-server

配置 Redmine

svn co https://svn.redmine.org/redmine/branches/5.1-stable redmine-5.1
cd redmine-5.1/
cp config/database.yml.example config/database.yml
bundle config mirror.https://rubygems.org https://gems.ruby-china.com
bundle install
RAILS_ENV=production bundle exec rails db:create
RAILS_ENV=production bundle exec rails db:migrate
RAILS_ENV=production bundle exec rake redmine:load_default_data
bundle exec rake generate_secret_token
# 启动服务
bundle exec rails server -p 3000 -b 0.0.0.0 -e production -d

下一步

恭喜你!你的 Redmine 系统已经部署好了,马上前往 http://ip:3000 开始使用 Redmine 吧!🎉

接下来可能要做的:Redmine 配置邮件通知