CentOS 6.4 x64 安裝 配置 Redmine 2.4.1

丶小炒肉發表於2016-05-31

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 &

相關文章