Redmine 是用Ruby 开发的基于基于web 的项目管理软件,是用ROR 框架开发的一套跨平台项目管理系统
之前安装redmine 总是出各种错,纠结之,故安装后,整理之,备忘之!
(1) 安装相关依赖包
# yum install zlib-devel openssl-devel perl cpio expat-devel gettext-devel curl git readline-devel
gcc gcc-c++
#vi /etc/ld.so.conf #######加入########
/usr/local/lib
#/sbin/ldconfig
#bash < <(curl http://rvm.beginrescueend.com/releases/rvm-intsall-head ) 出错如下
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 184 100 184 0 0 95 0 0:00:01 0:00:01 --:--:-- 0
bash: line 1: html: 没有那个文件或目录
bash: line 2: syntax error near unexpected token `<'
'ash: line 2: `301 Moved Permanently
可使用下面的连接即可
# bash < <(curl -s ) 出
错如下
bash: line 154: git: command not found
bash: line 156: git: command not found
ERROR: Unable to clone the RVM repository, attempted both git:// and https://
(2)安装git 即可
#wget
# tar zxf git-latest.tar.gz
# cd git-2011-11-09/
#make prefix=/usr/local all
#make prefix=/usr/local install
#echo ‘[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM
function ’ >>/etc/profile 添加环境变量
换用户验证环境变量是否配置好
#sudo su - Aubby
#type rvm | head –n1 若显示rvm is a function 则证明RVM 环境配置工程
#rvm –v 显示RVM 当前版本
#rvm list 显示RVM 当前的软件列表
(3)下载安装ruby
#yum install gcc
#tar zxf ruby-1.8.7.tar.gz
# cd ruby-1.8.7
# ./configure --perfix=/usr/local/ruby/ && make && make install
在全局环境变量/etc/profile 里加入
export PATH=/usr/local/ruby/bin:/$PATH
(4)下载安装rubygems
# tar zxf rubygems-1.3.5.tgz
# cd rubygems-1.3.5
# cd rubygems-1.3.5
#ruby setup.rb
(5)下载安装rails
#gem source -r 删除以前的更新站点
#gem source -a 添加现在的更新站点
若嫌上面的源速度太慢,可以使用淘宝的源站
安装完ruby 后注意更新下站点,不然有可能相关的包安装不上,注(修改了站点,因网络
问题依然无法安装,可手动去 这个站点下载)
#gem install rails –-local (下载到本地安装)
#gem install rails –v=2.3.5 (直接通过源站安装)
在安装rails 的时候会提示很多依赖错误,不用担心,根据提示安装所需的包即可
网速相当给力的童鞋可直接gem install rails –remote
然后会自动输出:
Install required dependency activerecord?
Install required dependency actionpack?
Install required dependency actionmailer?
Install required dependency activeresource?
依次yes 依赖文件,自动安装---
(6)下载安装rack redmine
#gem install rack –v=1.0.1
#tar zxf redmine-1.1.1.tar.gz
#mv redmine-1.1.1. /usr/local/
(7)编译安装数据库
#tar xzvf cmake-2.8.3.tar.gz
# cd cmake-2.8.3/
#./configure &&make && make install
安装完cmake 后,编译mysql
1,添加mysql 用户,如果之前安装过mysql 已经存在mysql 用户,掠过此步
useradd -M -r --shell /sbin/nologin --home-dir /usr/local/mysql mysql
2, 下载mysql 5.5.17 , 编译安装, 我安装的目录在: /usr/local/mysql 数据库存放在
/var/lib/mysql 下
# tar xzvf mysql-5.5.8.tar.gz
# cd mysql-5.5.8/
# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DDEFAULT_CHARSET=utf8
-DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all
-DWITH_SSL=system -DWITH_EMBEDDED_SERVER=1 -DENABLED_LOCAL_INFILE=1
-DWITH_MYISAM_STORAGE_ENGINE=1
# make && make test && make install
# chown -R mysql:mysql /usr/local/mysql
# chown -R mysql:mysql /var/lib/mysql
3.安装默认数据库
#./scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/var/lib/mysql --user=mysql
4. 登录修改密码:mysql -u root -h localhost,默认密码为空,直接按回车进入。
# update user set password=PASSWORD('123456') where user='root';
5 复制mysql 配置文件:
# cp ./support-files/my-medium.cnf /etc/my.cnf
6 生成启动脚本:
# cp support-files/mysql.server /etc/init.d/mysqld
7 添加开机启动
# chkconfig --add mysqld
# chkconfig mysqld on
启动mysql
# ./bin/mysqld_safe --user=mysql --data=/var/lib/mysql&
8 创建相关数据库
mysql>create database redmine character set utf8;
mysql> grant all privileges on redmine.* to 'redmine'@'localhost' identified by 'admin';
mysql> flush privileges;
9.修改redmine 数据库关联文件
#cd /usr/local/redmine/config
#cp config/database.yml.example config/database.yml
#vi database.yml
production:
adapter: mysql
database: redmine
host: localhost
username: redmine
password: admin
(8)安装ruby的数据库调试器
Ruby 发行包中虽然自带有ruby 的mysql 调试器,对于线上环境,为了使其达到更好的性能,
可自己下载编译安装。下载地址:
# tar zxf mysql-ruby-2.8.1.tar.gz
# cd mysql-ruby-2.8.1
#ruby extconf.rb --with-mysql-dir=/usr/local/mysql/
#make && make install
此处--with-mysql-dir 所跟的路径是mysql 的安装路径
(9)生成会话存储密钥
# rake generate_session_store
// Missing the i18n 0.4.2 gem. Please `gem install -v=0.4.2 i18n` // 需要安装il8n.0.4.2.gem
#gem install il8n -v=0.4.2 安装提示的gem 包即
(10)生成数据库文件出错
# rake db:migrate RAILS_ENV="production"
报错:uninitialized constant ActiveSupport::Dependencies::Mutex
解决方法:rails 和rubygems 版本不匹配,rubygems 降到1.3.5 试试
报错: A key is required to write a cookie containing the session data. Use
config.action_controller.session = {:key=>"_myapp_session", :secret=> "some secret phrase" } in
config/environment.rb
解决方法:rake config/initializers/session_store.rb
报错: !!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the
mysql gem and try again: gem install mysql.
rake aborted!
需要安装mysql 适配器。gem install mysql 或者手动编译安装mysql 调试器
(11)加载默认配置
#rake redmine:load_default_data RAILS_ENV="production"
这里会要求选择默认语言,选中文zh:
Select language: bg, ca, cs, da, de, en, es, fi, fr, he, hu, it, ja, ko, lt, nl, no, pl, pt, pt-br, ro, ru, sk, sr,
sv, th, tr, uk, vn, zh, zh-tw [en] zh
这个默认设置只是在未登录时的界面语言,当用户登录后,默认语言还是英语,在My account
里可以修改成其它语言。
(12) 启动WEB服务加入开机启动
# ruby script/server webrick -e production
#vi redmine_start.sh 把脚本加入到rc.local
#!/bin/bash
cd /usr/local/redmine-1.1.1
/usr/local/ruby/bin/ruby script/server webrick -e production -d
之后就可以通过 来访问redmine web 管理页面了,redmine 默认密码官
网上有提示()一般默认情况下都是admin admin
阅读(3495) | 评论(0) | 转发(0) |