對這文章發表回應
發表限制: 非會員 可以發表
發表者: 冷日 發表時間: 2011/11/21 9:48:21
冷日今天測試安裝了一個Redmine。
這裡把冷日的過程記錄下來:
首先,先把ruby相關的東西裝起來:
但是呢,rubygems用yum裝的是1.3.x(忘記抄版本了)
所以還是要乖乖的去裝1.4.2:
順帶一題,冷日安裝時,看到rubygems的最新版本是1.8.11,但這個版本裝起來也怪怪低(應該是因為官方說redmine和rubygems1.5以上不合),所以還是乖乖的裝1.4.2吧!
再來就是redmine的安裝:
redmine裝完以後,要幫他作gem設定檔:
然後是用gem安裝一些必須的環境:
這裡大家可以看到,一開駛向上面那樣安裝的話rack版本是1.0.1的時候,後面會有問題!
因為rack版本的不符,所以要特別裝(更新)一次rack:
最後那個update是安裝後建議我更新低,當然就乖乖更新囉!
再執行bundle install的話,就可以看到rack已經更新為1.1.1了,冷日是這樣才OK低:
新增mysql資料庫:
再來設定redmine的資料庫連結設定檔:
最後三個動作:
產生Redmine所需的Session Store
Migrate the Database models
載入Redmine預設資料
上述如果都沒有錯誤的話,就可以啟動redmine來玩囉:
補充:
Redmine的官方下載:https://rubyforge.org/frs/?group_id=1850&release_id=46368
rubygems官方下載:http://rubyforge.org/frs/?group_id=126
這裡把冷日的過程記錄下來:
首先,先把ruby相關的東西裝起來:
# yum -y install ruby
# yum -y install ruby-devel
# yum -y install ruby-docs
# yum -y install ruby-rdoc
# yum -y install rubygems
但是呢,rubygems用yum裝的是1.3.x(忘記抄版本了)
所以還是要乖乖的去裝1.4.2:
# wget http://rubyforge.org/frs/download.php/73882/rubygems-1.4.2.tgz
# tar -zxvf rubygems-1.4.2.tgz
# ruby ./setup.rb
RubyGems 1.4.2 installed
順帶一題,冷日安裝時,看到rubygems的最新版本是1.8.11,但這個版本裝起來也怪怪低(應該是因為官方說redmine和rubygems1.5以上不合),所以還是乖乖的裝1.4.2吧!
再來就是redmine的安裝:
# wget --no-check-certificate https://rubyforge.org/frs/download.php/75518/redmine-1.2.2.tar.gz
# tar -zxvf redmine-1.2.2.tar.gz
# mv redmine-1.2.2 redmine
# chown -Rf apache:root redmine && chmod -Rf 0774 redmine
# cd redmine
# gem install bundler
Successfully installed bundler-1.0.21
1 gem installed
Installing ri documentation for bundler-1.0.21...
Installing RDoc documentation for bundler-1.0.21...
redmine裝完以後,要幫他作gem設定檔:
# vi Gemfile
source :rubygems
source "http://rubygems.org"
source :rubyforge
source "http://gems.rubyforge.org"
source :gemcutter
source "http://gemcutter.org"
gem "rake", "0.8.7"
gem "rack", "1.1.1"
gem "i18n", "0.4.2"
gem "rubytree", "0.5.2", :require => "tree"
gem "RedCloth", "~>4.2.3", :require => "redcloth" # for CodeRay
gem "mysql"
gem "coderay", "~>0.9.7"
gem "rails", "2.3.11"
然後是用gem安裝一些必須的環境:
# gem install rails -v=2.3.11 --no-ri --no-rdoc
Fetching: rake-0.9.2.2.gem (100%)
Fetching: activesupport-2.3.11.gem (100%)
Fetching: activerecord-2.3.11.gem (100%)
Fetching: rack-1.1.2.gem (100%)
Fetching: actionpack-2.3.11.gem (100%)
Fetching: actionmailer-2.3.11.gem (100%)
Fetching: activeresource-2.3.11.gem (100%)
Fetching: rails-2.3.11.gem (100%)
Successfully installed rake-0.9.2.2
Successfully installed activesupport-2.3.11
Successfully installed activerecord-2.3.11
Successfully installed rack-1.1.2
Successfully installed actionpack-2.3.11
Successfully installed actionmailer-2.3.11
Successfully installed activeresource-2.3.11
Successfully installed rails-2.3.11
8 gems installed
# gem install i18n -v=0.4.2 --no-ri --no-rdoc
Fetching: i18n-0.4.2.gem (100%)
Successfully installed i18n-0.4.2
1 gem installed
# gem install mysql --no-ri --no-rdoc
Fetching: mysql-2.8.1.gem (100%)
Building native extensions. This could take a while...
Successfully installed mysql-2.8.1
1 gem installed
# gem install cgi_multipart_eof_fix --no-ri --no-rdoc
Fetching: cgi_multipart_eof_fix-2.5.0.gem (100%)
Successfully installed cgi_multipart_eof_fix-2.5.0
1 gem installed
# gem install coderay --no-ri --no-rdoc
Fetching: coderay-1.0.4.gem (100%)
Successfully installed coderay-1.0.4
1 gem installed
這裡大家可以看到,一開駛向上面那樣安裝的話rack版本是1.0.1的時候,後面會有問題!
# bundle install
Fetching source index for http://rubygems.org/
Fetching source index for http://rubygems.org/
Fetching source index for http://rubygems.org/
Fetching source index for http://gems.rubyforge.org/
Fetching source index for http://rubygems.org/
Fetching source index for http://gemcutter.org/
Installing rake (0.8.3)
Installing RedCloth (4.2.8) with native extensions
Installing coderay (0.9.8)
Installing hoe (2.12.3)
Using i18n (0.4.2)
Using mysql (2.8.1)
Installing rack (1.0.1)
Installing rubytree (0.5.2)
Using bundler (1.0.21)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
因為rack版本的不符,所以要特別裝(更新)一次rack:
# gem install -v=0.8.7 rake
# gem install -v=1.1.1 rack
# gem install -v=0.4.2 i18n
# gem install -v=2.3.11 rails
# bundle update rake
最後那個update是安裝後建議我更新低,當然就乖乖更新囉!
再執行bundle install的話,就可以看到rack已經更新為1.1.1了,冷日是這樣才OK低:
# bundle install
Using rake (0.8.7)
Using RedCloth (4.2.8)
Using activesupport (2.3.11)
Using rack (1.1.1)
Using actionpack (2.3.11)
Using actionmailer (2.3.11)
Using activerecord (2.3.11)
Using activeresource (2.3.11)
Using coderay (0.9.8)
Using hoe (2.12.3)
Using i18n (0.4.2)
Using mysql (2.8.1)
Using rails (2.3.11)
Using rubytree (0.5.2)
Using bundler (1.0.21)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
新增mysql資料庫:
# mysql -u root -p
Mysql> create database redmine character set utf8;
Mysql> exit
再來設定redmine的資料庫連結設定檔:
# cd config
# cp database.yml.example database.yml
# vi database.yml
# MySQL (default setup).
production:
adapter: mysql
database: {your database name(default:redmine)}
host: {your database address}
username: {your username that can access the database you set before}
password: {your password that pair of the username you set before}
encoding: utf8
development:
adapter: mysql
database: {your database name(default:redmine_development)}
host: {your database address}
username: {your username that can access the database you set before}
password: {your password that pair of the username you set before}
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: mysql
database: redmine_test
host: localhost
username: root
password:
encoding: utf8
test_pgsql:
adapter: postgresql
database: redmine_test
host: localhost
username: postgres
password: "postgres"
test_sqlite3:
adapter: sqlite3
database: db/test.sqlite3
最後三個動作:
產生Redmine所需的Session Store
# RAILS_ENV=production bundle exec rake generate_session_store
Migrate the Database models
# RAILS_ENV=production bundle exec rake db:migrate
載入Redmine預設資料
# RAILS_ENV=production bundle exec rake redmine:load_default_data
上述如果都沒有錯誤的話,就可以啟動redmine來玩囉:
# ruby script/server -e production
補充:
Redmine的官方下載:https://rubyforge.org/frs/?group_id=1850&release_id=46368
rubygems官方下載:http://rubyforge.org/frs/?group_id=126