Linux下安装项目管理工具Redmine

Posted on Posted in 经验分享

Linux下安装项目管理工具Redmine
1、Ruby安装
Ruby on Rails网站推荐使用1.8.7版。

点击(此处)折叠或打开

  1. wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p174.tar.gz
  2. tar zxvf ruby-1.8.7-p174.tar.gz
  3. cd ruby-1.8.7-p174
  4. ./configure –prefix=/usr/local/ruby
  5. make && make install

设置Ruby环境变量

点击(此处)折叠或打开

  1. cd ~
  2. vi .bash_profile

添加下面一行

点击(此处)折叠或打开

  1. export PATH=$PATH:/usr/local/ruby/bin

保存退出:wq
. .bash_profile
2、RubyGems安装

点击(此处)折叠或打开

  1. wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
  2. tar zxvf rubygems-1.3.5.tgz
  3. cd rubygems-1.3.5
  4. ruby setup.rb

3、Rake安装

点击(此处)折叠或打开

  1. gem install rake //直接使用gem命令安装rake.
  2. //也可以下载安装地址:http://rubyforge.org/frs/download.php/56872/rake-0.8.7.tgz

4、Ruby on Rails

点击(此处)折叠或打开

  1. gem install rails
  2. 安装成功提示:
  3. Successfully installed activesupport-2.3.3
  4. Successfully installed activerecord-2.3.3
  5. Successfully installed rack-1.0.0
  6. Successfully installed actionpack-2.3.3
  7. Successfully installed actionmailer-2.3.3
  8. Successfully installed activeresource-2.3.3
  9. Successfully installed rails-2.3.3
  10. 7 gems installed
  11. Installing ri documentation for activesupport-2.3.3…
  12. Installing ri documentation for activerecord-2.3.3…
  13. Installing ri documentation for rack-1.0.0…
  14. Installing ri documentation for actionpack-2.3.3…
  15. Installing ri documentation for actionmailer-2.3.3…
  16. Installing ri documentation for activeresource-2.3.3…
  17. Installing ri documentation for rails-2.3.3…
  18. Installing RDoc documentation for activesupport-2.3.3…
  19. Installing RDoc documentation for activerecord-2.3.3…
  20. Installing RDoc documentation for rack-1.0.0…
  21. Installing RDoc documentation for actionpack-2.3.3…
  22. Installing RDoc documentation for actionmailer-2.3.3…
  23. Installing RDoc documentation for activeresource-2.3.3…
  24. Installing RDoc documentation for rails-2.3.3…
  25. //也可以下载安装地址:http://rubyforge.org/frs/download.php/60599/rails-2.3.3.tgz

5、Redmine安装

点击(此处)折叠或打开

  1. wget http://rubyforge.org/frs/download.php/56909/redmine-0.8.4.tar.gz
  2. tar zxvf redmine-0.8.4.tar.gz
  3. mv redmine-0.8.4 /usr/local/redmine
  4. cd /usr/local/redmine/config

设置数据库参数

点击(此处)折叠或打开

  1. cp database.yml.example database.yml
  2. vi database.yml
  3. production:
  4. adapter: mysql
  5. database:redmine
  6. host: localhost
  7. username: redmineuser
  8. password: redminepw
  9. encoding: utf8
  10. 保存退出:wq

创建mysql数据库

点击(此处)折叠或打开

  1. /usr/local/mysql/bin/mysql -u root -p
  2. Mysql> create database redmine default character set utf8;
  3. grant all on redmine.* to root;
  4. grant all on redmine.* to root@localhost;
  5. grant all on redmine.* to redmineuser;
  6. grant all on redmine.* to redmineuser @localhost;
  7. set password for redmineuser@localhost=password(‘redminpw’);
  8. Mysql>exit;

Remine设定
(注意此时的目录一定要在redmine/config里,不然会出错,本文后面有错误信息。)

点击(此处)折叠或打开

  1. rake db:migrate RAILS_ENV=”production” //创建表
  2. # rake redmine:load_default_data RAILS_ENV=”production” //加载默认配置

这里会要求选择默认语言,我选的中文zh:

点击(此处)折叠或打开

  1. 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里可以修改成其它语言。
启动WEB服务

点击(此处)折叠或打开

  1. ruby script/server webrick -e production
  2. 或# ruby /usr/local/redmine/script/server webrick -e production

停止web服务方法:在当前启动窗口按ctrl+C
访问http://ip:3000/
初始用户名/密码:admin/admin
这样启动后,启动窗口是不能关闭的,所以要使Redmine作为服务启动,需添加-d参数:

点击(此处)折叠或打开

  1. ruby script/server webrick -e production -d
  2. 或# ruby /usr/local/redmine/script/server webrick -e production –d

停止服务方法:(ps命令查出此进程的pid号,再杀掉,目前好像只能这样,我看了–help里面,还没有停止的参数。)

点击(此处)折叠或打开

  1. ps aux | grep ruby
  2. # kill -9 [PID]

OK,安装完毕!可以进去玩了!哈哈!

发表评论