1.安装mysql
sudo apt-get install mysql-server-5.6 mysql-client-5.6
2.修改mysql绑定的127.0.0.1信息
修改文件/etc/mysql/my.cnf
修改完重启
sudo service mysql stop
sudo service mysql start
3.登录数据库确认是否正常
mysql -u root -p
4.创建数据库和用户
CREATE DATABASE redmine CHARACTER SET utf8; CREATE USER ‘redmine‘@‘localhost‘ IDENTIFIED BY ‘my_password‘; GRANT ALL PRIVILEGES ON redmine.* TO ‘redmine‘@‘localhost‘;
5.解压下载后的redmine文件
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
Redmine 安装 Ububtu 14.04 LTS,布布扣,bubuko.com
原文:http://my.oschina.net/farces/blog/295921