yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel


yum install mysql-devel


安装rvm

curl -L get.rvm.io | bash -s stable


source /etc/profile.d/rvm.sh


rvm -v


sed -i -e 's/ftp\.ruby-lang\.org\/pub\/ruby/ruby\.taobao\.org\/mirrors\/ruby/g' /usr/local/rvm/config/db


rvm list known #查看有哪些东东


rvm install 2.0.0


rvm 2.0.0 --default


ruby -v


gem -v


设置gem源:

gem source -r https://rubygems.org/

gem source -a http://ruby.taobao.org

如果gem无法添加,可以修改vi /etc/resolv.conf

只保留nameserver 114.114.114.114,然后再次添加试试


gem install rails -v=2.3.5


rails -v


create database redmine character set utf8;


redmine2.5.1解压到/usr/local下

cd /usr/local/redmine

cd config

cp出来一个database.yml,然后修改production中的内容,参考下面的

production:

  adapter: mysql2

  database: redmine

  host: localhost

  username: root

  password: 123123


cd /usr/local/redmine

gem install bundler

bundle install --without development test rmagick or bundle install --without development test

(如果重新修改了database.yml则需要重新运行上面的命令哦)


rake generate_secret_token


RAILS_ENV=production rake db:migrate


RAILS_ENV=production rake redmine:load_default_data

选择zh


#ruby script/rails server webrick -e production

#ruby /usr/local/redmine/script/rails server webrick -e production –d #以服务形式启动


gem install mongrel --pre

vi Gemfile

加入gem 'mongrel','~> 1.2.0.pre2'

ruby /usr/local/redmine/script/rails server mongrel -e production -d #此方式运行快


登录:

admin

admin


设置redmine自启动:

which ruby#查看ruby的路径

vi /etc/rc.local

添加如下内容:

echo "start redmine:"

/usr/local/rvm/rubies/ruby-2.0.0-p451/bin/ruby /usr/local/redmine/script/rails server mongrel -e production –d

sh /etc/rc.local


原因:redhat防火墙屏蔽了端口3000

解决办法: 配置防火墙,开放宽口3000                

# /sbin/iptables -I INPUT -p tcp --dport 3000 -j ACCEPT

# /etc/rc.d/init.d/iptables save

# service iptables restart


配置发mail:

vi configuration.yml

 production:

   email_delivery:

     delivery_method: :smtp

     smtp_settings:

       address: "smtp.126.com"

       port: 25

       authentication: :login

       domain: '126.com'

       user_name: 'xxx'

       password: 'xxx'


PS:如果要修改系统自带的字段(bug的),可对redmine/app/views/issues/_attributes.html.erb

样式和js是redmine-3.3.2/public下stylesheets和javascripts中的application.css