安装Redmine 2.0

Redmine 这厮就这样大张旗鼓的升级到了2.0。正好公司的mantisbt实在是不给力,就准备安装Redmine。很之前安装的方法并没有什么区别,可以参考之前安装CentOS 6 安装Redmine。特此记录下。 下载Ruby 1.8.7稳定版即可。

cd ~

wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7.tar.gz

tar  xzvf ruby-1.8.7.tar.gz

cd ruby-1.8.7

./configure

make && make install

查看Ruby的版本,会报错。

ruby -v

-bash: /usr/bin/ruby: No such file or directory

查看ruby的安装路径

which ruby

/usr/local/bin/ruby

where ruby

ruby: /usr/lib/ruby /usr/local/bin/ruby /usr/local/lib/ruby

修复ruby的路径问题

ln -s /usr/local/bin/ruby /usr/bin/ruby

现在可以查看ruby的版本了

ruby -v

ruby 1.8.7 (2008-05-31 patchlevel 0) [i686-linux]

安装rubygems

wget http://production.cf.rubygems.org/rubygems/rubygems-1.4.2.tgz

tar xzvf rubygems-1.4.2.tgz

cd rubygems-1.4.2

ruby setup.rb

RubyGems 1.4.2 installed

修复gem的路径问题

ln -s /usr/local/bin/gem /usr/bin/gem

gem -v

1.4.2

安装 passenger模块

gem install passenger

//安装passenger的apache模块,同样也有nginx下的模块
//passenger-install-nginx-module

passenger-install-apache2-module

会提示你有哪些依赖没有被安装。

To install GNU C++ compiler:
Please run yum install gcc-c++ as root.

To install Curl development headers with SSL support:
Please run yum install curl-devel as root.

To install Zlib development headers:
Please run yum install zlib-devel as root.

yum install gcc-c++

yum install curl-devel

yum install zlib-devel

passenger-install-apache2-module

安装完成后 添加 配置到apache的配置文件

vim /etc/httpd/conf/httpd.conf

LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.12/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.12
PassengerRuby /usr/local/bin/ruby

service httpd restart

从rubyforge下载redmine

wget http://rubyforge.org/frs/download.php/76134/redmine-2.0.0.tar.gz

tar xzvf redmine-2.0.0.tar.gz

cp -rf redmine-2.0.0 /var/www/redmine

//设置相关属性
cd /var/www

chmod 755 -R redmine

chown apache.apache -R redmine

添加网站配置文件

DocumentRoot /var/www/redmine/public
ServerName pms.xbc.me

添加数据库配置文件

cd redmine/config

cp database.yml.example database.yml

vim database.yml

production:
adapter: mysql
database: redmine
host: localhost
username: redmine
password: my_password
encoding: utf8

chmod 755 -R database.yml

chown apache.apache -R database.yml

不要忘记了 redmine 1.4以后添加bundler依赖。

gem install bundler

bundle install --without development test

如果在bundle安装时,出现下面的这些错误的话,去掉一些不需要的扩展。

An error occured while installing pg (0.13.2), and Bundler cannot continue.
An error occured while installing rmagick (2.13.1), and Bundler cannot continue.
An error occured while installing sqlite3 (1.3.6), and Bundler cannot continue.

bundle install --without development test postgresql rmagick sqlite

生成session 密钥

cd /var/www/redmine

//Generate a session store secret.
rake generate_secret_token

创建数据库结构。

//Create the database structure, by running the following command under the application root directory:

RAILS_ENV=production rake db:migrate

导入默认的配置文件

RAILS_ENV=production rake redmine:load_default_data

安装环境为Centos 5.6+Apache2.2。

参考
1. bundle install error
2. redmine wiki RedmineInstall

“安装Redmine 2.0”的2个回复

发表评论

电子邮件地址不会被公开。 必填项已用*标注