一、软件版本
Yaml 0.1.4
:
http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
Ruby-1.9.3-p194: http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
Rubygems-1.8.24
: http://rubygems.org/pages/download
Redmine-2.0.3
: http://rubyforge.org/frs/?group_id=1850
二、
安装Redmine(Apache+SVN+Passenger)
1.
安装Yaml
[root@cent5-ADCPtest]# cd /opt/software/
[root@cent5-ADCPtest software]# wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
[root@cent5-ADCPtest software]# tar zxf yaml-0.1.4.tar.gz
[root@cent5-ADCPtest software]# cd yaml-0.1.4
[root@cent5-ADCPtest yaml-0.1.4]# ./configure --prefix=/opt/yaml
[root@cent5-ADCPtest yaml-0.1.4]# make && make install
2.
安装Ruby
[root@cent5-ADCPtest software]# tar zxf ruby-1.9.3-p194.tar.gz
[root@cent5-ADCPtest software]# cd ruby-1.9.3-p194
[root@cent5-ADCPtest ruby-1.9.3-p194]# ./configure --prefix=/opt/ruby
[root@cent5-ADCPtest ruby-1.9.3-p194]# make && make install
注:
ruby
安装到自定义路径,下面的
ruby,rake,gem
命令都要加上
Ruby
安装的绝对路径,如
/opt/ruby/bin/ruby /opt/ruby/bin/rake /opt/ruby/bin/gem
3.
安装
Redmine
[root@cent5-ADCPtest software]# tar zxf redmine-2.0.3.tar.gz
[root@cent5-ADCPtest software]# mv redmine-2.0.3 /opt/redmine
4.
安装Rubygems
[root@cent5-ADCPtest software]# tar zxf rubygems-1.8.24.tgz
[root@cent5-ADCPtest software]# cd rubygems-1.8.24
[root@cent5-ADCPtest rubygems-1.8.24]# ruby setup.rb
/opt/ruby/lib/ruby/1.9.1/yaml.rb:56:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
RubyGems 1.8.24 installed
== 1.8.24 / 2012-04-27
* 1 bug fix:
* Install the .pem files properly. Fixes #320
* Remove OpenSSL dependency from the http code path
-----------------------------------------------------------------------------
RubyGems installed the following executables:
/opt/ruby/bin/gem
[root@cent5-ADCPtest rubygems-1.8.24]# /opt/ruby/bin/gem install rails -v=3.2.6
//安装rails,-v=3.2.6是版本号
[root@cent5-ADCPtest rubygems-1.8.24]# /opt/ruby/bin/gem install bundler //Redmine 1.4
版本后使用Bundler
来管理gems
依赖关系,在Redmine
的目录里有一个Gemfile
需要的依赖包写在里面。
/opt/ruby/lib/ruby/1.9.1/yaml.rb:56:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
Successfully installed bundler-1.1.5
1 gem installed
Installing ri documentation for bundler-1.1.5...
Installing RDoc documentation for bundler-1.1.5...
[root@cent5-ADCPtest redmine]# vim Gemfile //
由于使用的是Mysql
数据库,需要将Gemfile
中的配置关于PostgreSQL
的安装包注释掉,如果系统没有安装PostgreSQL
而不注释掉,安装时会提示错误。
# Database gems
#platforms :mri, :mingw do
# group :postgresql do
# gem "pg", ">= 0.11.0"
# end
#
# group :sqlite do
# gem "sqlite3"
# end
#end
[root@cent5-ADCPtest redmine]# bundle install --without development test rmagick //
这一步会安装Mysql
的Adapter
,
如果Mysql
的安装路径不是系统默认的,这一步安装时会提示安装错误,需要增加安装参数安装
单独安装 Mysql2
的依赖包
:
gem install mysql2 -v '0.3.11' -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
然后再运行上面的命令
5.创建数据库
mysql> create database redmine character set utf8;
mysql> grant all privileges on redmine.* to 'redmine'@'localhost' identified by 'my_password';
mysql> flush privileges;
[root@cent5-ADCPtest redmine]# cd config
[root@cent5-ADCPtest config]# cp database.yml.example database.yml
[root@cent5-ADCPtest config]# vim database.yml
# Default setup is given for MySQL with ruby1.8. If you're running Redmine
# with MySQL and ruby1.9, replace the adapter name with `mysql2`.
# Examples for PostgreSQL and SQLite3 can be found at the end.
production:
adapter:
mysql2 //将mysql修改为mysql2
database: redmine
host: localhost
username: redmine
password: redmine
encoding: utf8
[root@cent5-ADCPtest config]# rake generate_secret_token //
会产生config/initializers/secret_token.rb
[root@cent5-ADCPtest config]# RAILS_ENV=production rake db:migrate //
创建数据库结构
....
== ChangeChangesPathLengthLimit: migrating ===================================
-- change_column(:changes, :path, :text, {:default=>nil, :null=>true})
-> 0.0119s
-- change_column(:changes, :path, :text, {:null=>false})
-> 0.0105s
-- change_column(:changes, :from_path, :text)
....