1. 程式人生 > >Ubuntu 12 04安裝Redmine 2 4 2

Ubuntu 12 04安裝Redmine 2 4 2

               

官方安裝文件參考:

首先安裝MySQL, 參考:

建立Redmin資料庫和使用者

mysql -u root -p 

CREATE DATABASE redmine CHARACTER SET utf8;CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'my_password';GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';

現在下載Redmine 2.4.2程式碼:

wget http://www.redmine.org/releases/redmine-2.4.2.tar.gztar zxvf redmine-2.4.2.tar.gz

安裝ruby1.9.3
apt-get install ruby1.9.3 

配置資料庫, 
cd configcp database.yml.example database.yml


編輯database.yml
production:  adapter: mysql2  database: redmine  host: localhost  username: redmine  password: "your_pwd"  encoding: utf8
下面在redmine-2.4.2目錄下執行命令安裝gem的依賴項:
[email protected]:/usr/src/redmine-2.4.2# gem install bundlerFetching: bundler-1.5.2.gem (100%)Successfully installed bundler-1.5.21 gem installedInstalling ri documentation for bundler-1.5.2...Installing RDoc documentation for bundler-1.5.2...

現在安裝redmine依賴項

bundle install --without development test



遇到一個錯誤:
An error occurred while installing mysql2 (0.3.14), and Bundler cannot continue.                                                                                                                                     Make sure that `gem install mysql2 -v '0.3.14'` succeeds before bundling.

用下面的命令修復:
apt-get install mysql-clientapt-get install libmysqlclient-dev


gem install mysql2 -v '0.3.14'

再次執行redmine安裝命令:
bundle install --without development test
得到新的錯誤資訊:
An error occurred while installing rmagick (2.13.2), and Bundler cannot continue.                                                                                                                                    Make sure that `gem install rmagick -v '2.13.2'` succeeds before bundling.

用下面的命令修復:
apt-get install libmagickcore-dev libmagickwand-dev

執行下面的命令完成安裝:
rake generate_secret_tokenRAILS_ENV=production rake db:migrateRAILS_ENV=production rake redmine:load_default_datamkdir -p tmp tmp/pdf public/plugin_assetschown -R 777 files log tmp public/plugin_assetschmod -R 755 files log tmp public/plugin_assets

啟動服務用於測試:
[email protected]:/usr/src/redmine-2.4.2# ruby script/rails server webrick -e production=> Booting WEBrick=> Rails 3.2.16 application starting in production on http://0.0.0.0:3000=> Call with -d to detach=> Ctrl-C to shutdown server[2014-01-11 18:49:18] INFO  WEBrick 1.3.1[2014-01-11 18:49:18] INFO  ruby 1.9.3 (2011-10-30) [x86_64-linux][2014-01-11 18:49:18] INFO  WEBrick::HTTPServer#start: pid=10173 port=3000Started GET "/" for 119.80.97.56 at 2014-01-11 18:49:35 +0800Processing by WelcomeController#index as HTML  Current user: anonymous  Rendered welcome/index.html.erb within layouts/base (36.7ms)Completed 200 OK in 437.0ms (Views: 145.0ms | ActiveRecord: 16.7ms)

用瀏覽器訪問一下,可以看到redmine的站點了。預設管理員帳號是

admin=admin