1.安裝mysqlmysql
sudo apt-get install mysql-server-5.6 mysql-client-5.6web
2.修改mysql綁定的127.0.0.1信息sql
修改文件/etc/mysql/my.cnf數據庫
修改完重啓ruby
sudo service mysql stop
sudo service mysql start cookie
3.登陸數據庫確認是否正常
session
mysql -u root -p測試
4.建立數據庫和用戶this
CREATE DATABASE redmine CHARACTER SET utf8; CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'my_password'; GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
5.解壓下載後的redmine文件spa
tar xzvf redmine-2.5.2.tar.gz
6.cp到/opt目錄下
sudo cp -Rf redmine-2.5.2 /opt/redmine-2.5.2
7.修改權限
sudo chown -Rf terry:terry redmine-2.5.2/
sudo chmod -Rf 775 redmine-2.5.2/
8.修改數據庫鏈接文件
9.主目錄(redmine解壓後根目錄)執行token信息
rake generate_secret_token(此命令出現的問題見後面的問題處理)
10.建立數據庫結構
RAILS_ENV=production rake db:migrate
此命令執行一路暢通
11. 初始化數據
RAILS_ENV=production rake redmine:load_default_data
此命令執行一路暢通,同時運行的過程當中選擇語言,我輸入的是zh
12.測試安裝是否成功
ruby script/rails server webrick -e production
測試經過
13.登陸系統
使用管理員admin/admin登陸系統
以上安裝方法參考官網資料進行安裝,地址:http://www.redmine.org/projects/redmine/wiki/RedmineInstall
問題:
1.rake generate_secret_token
Could not find gem 'rails (= 3.2.19) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
解決:執行bundle install如還不行,則sudo apt-get install rails後解決 ,最終經過修改配置文件中的版本號解決
2.An error occurred while installing mysql2 (0.3.16), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.3.16'` succeeds before bundling.
解決:sudo gem install mysql2 -v '0.3.16',若是還不行,則
sudo apt-get install libmysqlclient-dev,安裝後再運行上邊的命令
3.Could not find gem 'selenium-webdriver (>= 0) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
解決:sudo gem install selenium-webdriver
4.Could not find gem 'rack-openid (>= 0) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
解決:sudo gem install rack-openid
5.Could not find gem 'fastercsv (~> 1.5.0) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
解決:sudo gem install fastercsv
6.Could not find gem 'shoulda (~> 3.3.2) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
解決: sudo gem install shoulda
7.Could not find gem 'net-ldap (~> 0.3.1) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
解決:sudo gem install net-ldap
8.Could not find gem 'ruby-openid (~> 2.3.0) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
解決:sudo gem install ruby-openid
9.Could not find gem 'mocha (~> 1.0.0) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
解決:sudo gem install mocha
10.Could not find gem 'rmagick (>= 2.0.0) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
解決:sudo gem install rmagick
出現Can't install RMagick 2.13.2. Can't find Magick-config in /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin時
解決:
sudo apt-get install imagemagick libmagickwand-dev
11.Could not find gem 'redcarpet (~> 2.3.0) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
解決: sudo gem install redcarpet -v 2.3.0
12.Could not find gem 'capybara (~> 2.1.0) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
解決:sudo gem install capybara -v 2.1.0
13.Could not find gem 'yard (>= 0) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
解決:sudo gem install yard
14.登陸成功後報以下錯誤:
NoMethodError (undefined method `options' for {:user_id=>1, :ctime=>1406624849, :atime=>1406624849}:Hash):
rack (1.5.2) lib/rack/session/abstract/id.rb:329:in `commit_session'
rack (1.5.2) lib/rack/session/abstract/id.rb:226:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
/usr/lib/ruby/vendor_ruby/action_dispatch/middleware/cookies.rb:341:in `call'
/usr/lib/ruby/vendor_ruby/active_record/query_cache.rb:64:in `call'
/usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
/usr/lib/ruby/vendor_ruby/action_dispatch/middleware/callbacks.rb:28:in `block in call'
/usr/lib/ruby/vendor_ruby/active_support/callbacks.rb:405:in `_run__226998513__call__336786722__callbacks'
/usr/lib/ruby/vendor_ruby/active_support/callbacks.rb:405:in `__run_callback'
/usr/lib/ruby/vendor_ruby/active_support/callbacks.rb:385:in `_run_call_callbacks'
/usr/lib/ruby/vendor_ruby/active_support/callbacks.rb:81:in `run_callbacks'
解決方法:
sudo gem install rack -v 1.4.5
在根下增長Gemfile.local,內容爲gem "rack", "1.4.5",執行bundle update .
版本1.5.2有bug,參見官方的bug:http://www.redmine.org/issues/14652#note-3