Redmine 安装配置


1. 安装Redmine 所需的依赖

首先安装 yaml

wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz

tar zxvf yaml-0.1.4.tar.gz

cd yaml-0.1.4

./configure

make && make install



2. 安装RVM


curl -L https://get.rvm.io | bash -s stable

---------------------------------------------------------------------

报错   gpg: 无法检查签名:没有公钥  

执行:

curl -sSL https://rvm.io/mpapis.asc | gpg --import 

执行完毕,再执行一次上面的

---------------------------------------------------------------------


载入RVM环境并获取需要的支持安装包

source /etc/profile.d/rvm.sh

rvm requirements


3. 利用rvm安装 Ruby 1.9.3 并设为默认

rvm install 1.9.3

rvm use 1.9.3 --default



4. 安装Redmine  下载最新版本的 redmine


wget http://www.redmine.org/releases/redmine-2.4.1.tar.gz


tar zxvf redmine-2.4.1.tar.gz


mkdir /opt/htdocs


mv redmine-2.4.1 /opt/htdocs/redmine



5. 安装 Bundler   可利用ruby 的 gem 来安装


gem install bundler




6. 安装gem 依赖包


cd /opt/htdocs/redmine


bundle install --without development test rmagick



---------------------------------------------------------------------------

出现如下错误:

An error occurred while installing json (1.8.2), and Bundler cannot continue.

Make sure that `gem install json -v '1.8.2'` succeeds before bundling.


执行:

gem install json -v '1.8.2'


出现如下错误

Building native extensions.  This could take a while...

ERROR:  Error installing json:

        ERROR: Failed to build gem native extension.


安装: yum -y install ruby-devel 

---------------------------------------------------------------------------




7. 安装mysql2 的依赖包


gem install mysql2 -v '0.3.11' -- --with-mysql-config=/opt/local/mysql/bin/mysql_config



8. 创建redmine 所需的数据库


create database redmine character set utf8;


grant all privileges on redmine.* to 'redmine'@'localhost' identified by '123456';



9. 配置Redmine 数据库连接


cd /opt/htdocs/redmine/config


cp database.yml.example database.yml


vi database.yml

========================================================================

production:

 adapter: mysql2

 database: redmine

 host: localhost

 username: redmine

 password: "123456"

 encoding: utf8


development:

 adapter: mysql2

 database: redmine_development

 host: localhost

 username: redmine

 password: "123456"

 encoding: utf8


# Warning: The database defined as "test" will be erased and

# re-generated from your development database when you run "rake".

# Do not set this db to the same as development or production.

test:

 adapter: mysql2

 database: redmine_test

 host: localhost

 username: redmine

 password: "123456"

 encoding: utf8


==========================================================================



10. 创建sessin存储脚本


rake generate_secret_token


------------------------------------------------------------------------------------------

出现报错

Could not find gem 'rails (= 3.2.15) ruby' in the gems available on this machine.

Run `bundle install` to install missing gems.

------------------------------------------------------------------------------------------


首先执行 bundle update


-------------------------------------------------------------------------------------------------------------------------------------------

再次报错

Gem::RemoteFetcher::FetchError: Errno::ETIMEDOUT: Connection timed out - connect(2) (https://rubygems.org/gems/tilt-1.4.1.gem)

An error occurred while installing tilt (1.4.1), and Bundler cannot continue.

Make sure that `gem install tilt -v '1.4.1'` succeeds before bundling.

-------------------------------------------------------------------------------------------------------------------------------------------


单独执行 gem install tilt -v '1.4.1'



再次执行 bundle update  直到完成


Your bundle is updated!



11. 创建数据库结构:

RAILS_ENV=production rake db:migrate



12. 插入默认的配置数据:

RAILS_ENV=production rake redmine:load_default_data


13. 启动Redmine


ruby /opt/htdocs/redmine/script/rails server webrick -e production >/dev/null 2>> redmine.log &