安装准备组件
-
gcc编译环境:
1yum -y
install
gcc
-
其他组件:
1yum
install
flex autoconf zlib curl zlib-devel curl-devel
bzip2
bzip2
-devel ncurses-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel pam-devel gcc+ gcc-c++ libxml2 libxml2-devel libxslt libxslt-devel
安装libyaml
-
安装libyaml-0.1.4
123456wget http:
//pyyaml
.org
/download/libyaml/yaml-0
.1.4.
tar
.gz
tar
xzvf yaml-0.1.4.
tar
.gz
cd
yaml-0.1.4
.
/configure
--prefix=
/usr/local
make
make
install
-
安装libyaml-devel
-
安装源
1234//32
位系统
su
-c
'rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm'
//64
位系统
su
-c
'rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm'
-
安装libyaml-devel
1yum
install
libyaml-devel
安装MySQL
-
安装
1234567yum
install
mysql mysql-server mysql-devel
//
启动mysql
service mysqld start
/stop/restart
//
修改mysql密码
mysqladmin -uroot password
'new-password'
//
命令行登录
mysql -uroot -p
-
创建数据库
1CREATE DATABASE redmine CHARACTER SET utf8;
安装Ruby 1.9.3
-
安装
123456wget http:
//ftp
.ruby-lang.org
/pub/ruby/1
.9
/ruby-1
.9.3-p547.
tar
.gz
tar
zxvf ruby-1.9.3-p547.
tar
.gz
cd
ruby-1.9.3-p547
.
/configure
--prefix=
/usr/local/ruby
--
enable
-shared --disable-
install
-doc --with-opt-
dir
=
/usr/local/lib
--with-openssl
make
make
install
-
测试
1234ruby -
v
ruby 1.9.3p547 (2014-05-14) [x86_64-linux]
gem --version
1.8.23.2
-
环境
123456789vim
/etc/profile
//
在末尾添加
RUBY_HOME=
/usr/local/ruby
PATH=$PATH:$RUBY_HOME
/bin
export
RUBY_HOME PATH
//
保存退出,操作:ESC -> :wq
//
确认成效,
source
/etc/profile
-
ROOT环境
12alternatives --
install
/usr/bin/ruby
ruby
/usr/local/ruby/bin/ruby
300
alternatives --
install
/usr/bin/gem
gem
/usr/local/ruby/bin/gem
300
安装Rails
-
安装指定版本
1gem
install
rails -
v
"3.2.17"
-V
安装Bundler
-
安装
1gem
install
bundler -V
-
配置
1alternatives --
install
/usr/bin/bundle
bundle
/usr/local/ruby/bin/bundle
300
安装Redmine
-
安装准备
1yum
install
ImageMagick-devel
-
下载
1234wget http:
//www
.redmine.org
/releases/redmine-2
.5.1.
tar
.gz
tar
zxvf redmine-2.5.1.
tar
.gz
mv
redmine-2.5.1 redmine
cd
redmine
/config
-
修改数据库配置文件
1234//
修改配置信息文件
cp
database.yml.example database.yml
//
进入修改
vim database.yml
-
文件内容如下修改
123456789101112131415production:
adapter:mysql2
database:redmine
host:localhost
username:redmine
password:my_password
port:3306
development:
adapter:mysql2
database:redmine
host:localhost
username:redmine
password:my_password
port:3306
-
安装ruby组件
12//
进入redmine根目录,bundle执行注意不要使用root权限执行
bundle
install
--without development
test
-
生成密钥
1rake generate_secret_token
-
初始化数据库(如果已经有数据库结构,可以忽略此部)
12RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:load_default_data
-
构建文件结构以及权限
123mkdir
-p tmp tmp
/pdf
public
/plugin_assets
sudo
chown
-R redmine:redmine files log tmp public
/plugin_assets
sudo
chmod
-R 755 files log tmp public
/plugin_assets
-
运行
1默认 admin,admin
-
账号密码
12ruby script
/rails
server webrick -e production -p 3000
//
打开浏览器 http:
//localhost
:3000
本文转自 sundunjam 51CTO博客,原文链接:http://blog.51cto.com/sunspot/1427250,如需转载请自行联系原作者