1. 下载redmine发布版本,解压
extracted from redmine-2.4.2.tar.gz
2. 配置数据库
|
|
3. 配置数据库连接
config/database.yml.example 拷贝成 config/database.yml,修改后者。
这里用的是mysql,所以配置如下:
|
|
注意 :用的是ruby 1.9 ,adapter用的是mysql2 ;如果是ruby 1.8,adapter要用mysql
4. 安装下bundler,安装依赖包
先用 gem –version 看看有没有,用rvm装1.9,自带bundler。
|
|
只安装production要求的依赖包,具体依赖包信息参见redmine根目录下的Gemfile
|
|
注意:安装前还是看下Gemfile里边source指向的哪儿,https://rubygems.org,未必能顺利下载!
可以改成ruby-china的源 http://gems.ruby-china.org/
注意:Redmine automatically installs the adapter gems required by your database configuration by reading it from the config/database.yml file ,如果修改了adapter,重新要运行下bundle install
4.1. 出错 – mysql.h is missing. please check your installation of mysql and try again.
解决:
|
|
安装devel包后,继续执行bundle install
bundle install –without development test
…
Installing mysql2 0.3.18
4.2. 出错 – checking for Magick-config… no 安装rmagick出错
- 现象
|
|
- 解决
|
|
安装devel包后,继续执行bundle install
|
|
5. 更新 Session 加密随机数
|
|
bundle exec rake generate_secret_token
6. Database schema objects creation
RAILS_ENV=production bundle exec rake db:migrate
6.1. 导入基础数据
RAILS_ENV=production bundle exec rake redmine:load_default_data
7. 文件访问权限控制
创建redmine用户
useradd -s /sbin/nologin -c “redmine service user” redmine
The user account running the application must have write permission on the following subdirectories:
- files (storage of attachments)
- log (application log file production.log)
- tmp and tmp/pdf (create these ones if not present, used to generate PDF documents among other things)
- public/plugin_assets (assets of plugins)
E.g., assuming you run the application with a redmine user account:
|
|
8. 测试redmine是否安装成功
test in Redmine 2.x:
bundle exec ruby script/rails server webrick -e production
访问 http://localhost:3000/
Use default administrator account to log in:
|
|