安装redmine1.2.1 最大的问题是各个软件的版本很乱。
1、Ruby安装
Ruby on Rails网站推荐使用1.8.7版。
# wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p174.tar.gz
# tar zxvf ruby-1.8.7-p174.tar.gz
# cd ruby-1.8.7-p174
# ./configure --prefix=/usr/local/ruby
# make && make install
# ruby -v
ruby 1.8.7
2、RubyGems安装
在安装rails之前,要先安装rubygems。rubygems是ruby的在线包管理工具
rubygems-1.3.6.tgz
(经测试1.3.7版本不行。不匹配)
# wget
# tar xzvf rubygems-1.3.5.tgz
# cd rubygems-1.3.5/
# ruby setup.rb
# ln -s /usr/bin/gem1.8 /usr/bin/gem
# gem -v
1.3.6
3、Rake安装
# gem install rake //直接使用gem命令安装rake.
//也可以下载安装地址:
# gem install rake
Successfully installed rake-0.8.7
1 gem installed
Installing ri documentation for rake-0.8.7...
Installing RDoc documentation for rake-0.8.7...
# rake -V (是大V)
rake, version 0.8.7
4、Ruby on Rails
然后就可以安装rails了,在确认服务器已经连接互联网的情况下执行:
# gem install rails
# rails -v
5、Redmine安装
# tar zxvf redmine-1.2.1.tar.gz
# mv redmine-1.2.1.tar.gz /usr/local/redmine
# cd /usr/local/redmine/config
设置数据库参数
# cp database.yml.example database.yml
# vi database.yml
production:
adapter: mysql
database:redmine
host: localhost
username: redmine
password: redmine
encoding: utf8
6. 创建数据库
mysql> create database redmine character set utf8;
mysql> create user 'redmine'@'localhost' identified by 'redmine';
mysql> grant all privileges on redmine.* to 'redmine'@'localhost';
7.导入数据和配置
# /usr/local/redmine/config
(在这个目录下执行)
# rake db:migrate RAILS_ENV="production" //会创建47张表
a.这里可能会报错,是软件rake版本的事,用gem install rake -v=0.8.7
b.也可能报错Minssing the i18n 0.4.2 gem. Please 'gem install -v=0.4.2 i18n'
那么就执行gem install -v=0.4.2 i18n 就可以了。
c.如果报A key is required to write a cookie containing the session data. Use config.action_controller.session = { :key => "_myapp_session", :secret => "some secret phrase" } in config/environment.rb
那么执行rake config/initializers/session_store.rb
d.如果报The bundled mysql.rb dirver has been removed from Rails 2.2 install the mysql gem and try again: gem install mysql
# gem install mysql (如果这个不行,先执行下面的)
# sudo apt-get install libmysqlclient-dev
and then:
# gem install mysql
# rake redmine:load_default_data RAILS_ENV="production" //加载默认配置
这里会要求选择默认语言,我选的中文zh:
Select language: bg, ca, cs, da, de, en, es, fi, fr, he, hu, it, ja, ko, lt, nl, no, pl, pt, pt-br, ro, ru, sk, sr, sv, th, tr, uk, vn, zh, zh-tw [en] zh
这个默认设置只是在未登录时的界面语言,当用户登录后,默认语言还是英语,在My account里可以修改成其它语言。
8.启动和停止方法
启动方式
# ruby /usr/local/redmine/script/server webrick -e production –d
访问
初始用户名/密码:admin/admin
停止服务方法:(ps命令查出此进程的pid号,再杀掉)
--help里面,还没有停止的参数。
# ps aux | grep ruby
# kill -9 [PID]
特别要注意一下,下面红色的软件和版本,如果版本过低会报错,过高也不行。(我也不太懂,都是试出来的)
root@vps:/usr/local/src# gem list
*** LOCAL GEMS ***
abstract (1.0.0)
actionmailer (3.0.10)
actionpack (3.0.10)
activemodel (3.0.10)
activerecord (3.0.10)
activeresource (3.0.10)
activesupport (3.0.10)
arel (2.0.10)
builder (2.1.2)
bundler (1.0.18)
erubis (2.6.6)
i18n (0.5.0, 0.4.2)
mail (2.2.19)
mime-types (1.16)
polyglot (0.3.2)
rack (1.1.0, 1.0.1)
rack-mount (0.6.14)
rack-test (0.5.7)
rails (3.0.10)
railties (3.0.10)
rake (0.8.7)
rdoc (3.9.4)
thor (0.14.6)
treetop (1.4.10)
tzinfo (0.3.29)
说明:gem 和yum 很像
比如说你 rake (0.9.2)的,你想卸载安装0.8.7的,这样操作,
# gem uninstall rake -y
# gem install rake -v=0.8.7
这样就可以了。
修改redmine的端口号:
在redmine/vendor/rails/railties/lib/commands/server.rb文件中:
options = {
:Port => 3000,
:Host => "0.0.0.0",
:environment => (ENV['RAILS_ENV'] || "development").dup,
:config => RAILS_ROOT + "/config.ru",
:detach => false,
:debugger => false,
:path => nil
}
阅读(1997) | 评论(0) | 转发(0) |