搭建redmine笔记(redhat6.4 )

参考文章:http://aslamnajeebdeen.com/blog/how-to-uninstall-remove-ruby-gems
          http://irfen.iteye.com/blog/1365809
          http://www.cnblogs.com/baizhantang/archive/2012/12/20/2827061.html
          http://aslamnajeebdeen.com/blog/how-to-uninstall-remove-ruby-gems
          http://www.oschina.net/question/16_8357
          http://chrisrc.iteye.com/blog/1187014
          http://stackoverflow.com/questions/14117114/error-rake-rdoctask-is-obsolete-and-no-longer-supported-use-rdoc-task-ava
          http://www.redmine.org/boards/2/topics/22358
          http://wenku.baidu.com/view/e18f5cd3b14e852458fb5761.html
          http://blog.csdn.net/dilaomi123/article/details/11530507
          http://stackoverflow.com/questions/6510328/cant-rake-dbmigrate-beacause-of-unset-variable
          http://hi.baidu.com/ehelcpmssrbhirq/item/687bf0f35149492f743c4c17
          http://wenku.baidu.com/view/e18f5cd3b14e852458fb5761.html
          http://hi.baidu.com/mcspring/item/08545f14808bd0ddbf9042bc
          http://www.cnblogs.com/baizhantang/archive/2012/12/20/2827061.html

          http://www.redmine.org/projects/redmine/wiki/HowTo_install_Redmine_on_CentOS_5


安装方式有两种,一种手动安装,一种是BitNami提供的一键安装程序,下载了BitNami程序安装失败,所以使用手动安装。    
安装之前说明:看了无数文章,看瞎了眼,之前的经验都用不上了,毕竟ruby有自己的包管理系统,遇到问题主要是要细心解决包匹配的问题。
1.ruby安装
下载ruby,解压,安装。
[root@test-1]# wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.7-p357.tar.gz
[root@test-1]# tar -xvf ruby-1.8.7-p357.tar.gz
[root@test-1]# ./configure  --prefix=/usr/local/ruby
[root@test-1]# make
[root@test-1]# make install

2.安装rubygem,用他来安装其他软件,rubygems是ruby的在线包管理工具,可以从rubyforge下载rubygems:
http://rubyforge.org/projects/rubygems/
注意,ruby 1.8.7对应的rubygems版本是1.3.5   1.3.6是要1.8.7的ruby版本的
[root@test-1]# wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
[root@test-1]# tar -zxvf rubygems-1.3.5.tgz
[root@test-1]# ruby setup.rb

遇到问题命令没有反应,经查是数据源的问题,dns不能解析,换个数据源试试。
[root@test-1]# gem sources --remove http://rubygems.org/
[root@test-1 redmine-2.4.0]# gem sources -a http://ruby.taobao.org/
Error fetching http://ruby.taobao.org/:
        too many connection resets (http://ruby.taobao.org/specs.4.8.gz)
发现报错后,感觉可能是域名解析的缘故,所以ping了下,得到ip在进行添加。
[root@test-1 redmine-2.4.0]# ping ruby.taobao.org
PING ruby.taobao.org (110.75.120.11) 56(84) bytes of data.
64 bytes from 110.75.120.11: icmp_seq=1 ttl=243 time=38.0 ms

再次添加sources,以ip地址添加。
[root@test-1 redmine-2.4.0]# gem sources -a http://110.75.120.11/
[root@test-1]# gem sources -l
[root@test-1]# gem install rails --include-dependencies
 
-----------------------------------------------------------------
遇到问题,报ruby版本过低,那就安装ruby更高版本,或者安装rubygem 低版本,
卸载ruby 或者卸载rubygems,安装匹配版本。
卸载ruby
[root@test-1 bin]# whereis ruby
ruby: /usr/local/bin/ruby /usr/local/lib/ruby
[root@test-1 bin]# rm -rf /usr/lib/ruby
[root@test-1 bin]# rm -f /usr/local/bin/ruby

或者卸载rubygems,从走第2步
[root@test-1 rubygems-1.8.25]#  which gem
[root@test-1 rubygems-1.8.25]# rm -fr /usr/local/bin/gem

3.安装rails,一定要指定版本,保证版本之间的匹配。
[root@test-1]#  gem install rails -v=2.3.11

4.安装rack,指定版本。
[root@test-1]#gem install rack -v=1.1.1
如果出现版本不匹配问题,要卸载,重新安装。
[root@test-1]# gem uninstall rack -v=1.1.0
[root@test-1]# gem install rack -v=1.0.1

5.安装il8n,指定版本。
[root@test-1]#gem install i18n -v=0.4.2

6.安装redmine,配置数据库
[root@test-1]#wget http://rubyforge.org/frs/download.php/74722/redmine-1.1.3.tar.gz
[root@test-1]#mv redmine-1.1.3 redmine
[root@test-1]#rm -fr redmine-1.1.3.tar.gz
[root@test-1]#cd redmine/
[root@test-1]# redmine]#cp config/database.yml.example config/database.yml
[root@test-1]# redmine]#vi config/database.yml

#导入数据库表结构,执行如下命令,redmine启动了。
[root@test-1]#rake db:migrate RAILS_ENV="production"
[root@test-1]#rake db:migrate RAILS_ENV="production" --trace
[root@test-1]#rake generate_session_store

[root@test-1]#ruby script/server webrick -e production

Ruby提供一个安装Ruby程序为服务的包:mongrel_service。安装其实很简单,运行:gem install mongrel_service
[root@test-1 config]#gem install mongrel_service

安装Passenger,
[root@test-1 config]#gem install passenger
[root@test-1 config]#passenger-install-apache2-module

#If the second line does not work, do whereis passenger to find out where it is installed.
#So you can execute it like /usr/local/bin/passenger-install-apache2-module ...

The install process is interactive and you wil be told what to do. READ!


[root@test-1 config]#vi /etc/httpd/conf.d/welcome.conf

你可能感兴趣的:(搭建redmine笔记(redhat6.4 ))