行走思考 2012-11-22
1、安装mysql
create database redmine character set utf8; create user 'redmine'@'localhost' identified by 'redmine'; grant all privileges on redmine.* to 'redmine'@'localhost';
mkdir ruby
cd ruby
下载ruby
wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p352.tar.gz
解压ruby
tar zxvf ruby-1.8.7
安装ruby
cd ruby
./configure --prefix=/usr/local/ruby
make && make install
aptitude install libgemplugin-ruby
查看ruby是否安装成功
ruby -v
如果没有安装成功则执行下列命令:
aptitude install ruby
安装rubygems
2、rubygems
mkdir rails_install //用于存储gems
下载:wget http://rubyforge.org/frs/download.php/74445/rubygems-1.6.2.tgz
解压 tar zxvf rubygems-1.6.2.tgz
cd rubygems-1.6.2
安装: ruby setup.rb
查看是否安装成功
gem -v
如果没有安装成功:
aptitude install gem -y
3、安装rails及其相关gems
如果直接用gem install xxx 安装的,大都都安装不成功,不知是我这边网络问题还是其它原因,所以只好把用到的文件都下载回来再本地安装。
cd ~/rails_install
2: # wget http://rubygems.org/downloads/rake-0.8.3.gem
3: # wget http://rubygems.org/downloads/rack-1.1.0.gem
4: # wget http://rubygems.org/downloads/rails-2.3.11.gem
5: # wget http://rubygems.org/downloads/activesupport-2.3.11.gem
6: # wget http://rubygems.org/downloads/activerecord-2.3.11.gem
7: # wget http://rubygems.org/downloads/actionpack-2.3.11.gem
8: # wget http://rubygems.org/downloads/actionmailer-2.3.11.gem
9: # wget http://rubygems.org/downloads/activeresource-2.3.11.gem
10:
11: # wget http://rubygems.org/downloads/i18n-0.4.2.gem
12: # wget http://rubygems.org/downloads/mysql-2.8.1.gem
13: # wget http://rubygems.org/downloads/cgi_multipart_eof_fix-2.5.0.gem
14: # wget http://rubygems.org/downloads/coderay-1.0.0.gem
15:
16: # gem install --local rake-0.8.3.gem
17: # gem install --local rack-1.1.0.gem
18: # gem install --local rails-2.3.11.gem
19: # gem install --local mysql-2.8.1.gem
20: # gem install --local i18n-0.4.2.gem
21: # gem install --local cgi_multipart_eof_fix-2.5.0.gem
22: # gem install --local coderay-1.0.0.gem
4、安装redmine
wget http://rubyforge.org/frs/download.php/75097/redmine-1.2.1.tar.gz
打开复制出来的database.yml文件,配置production和development节点的mysql登录信息。
cd redmine/config
cp database.yml.example database.yml
修改database.yml
vim database.yml
添加之前建好的数据库
production:
2: adapter: mysql
3: database: redmine
4: host: localhost
5: username: redmine
6: password: redmine
development:(这个也要改否则添加插件的时候会出错)
2: adapter: mysql
3: database: redmine
4: host: localhost
5: username: redmine
6: password: redmine
生成session存储加密信息和数据库
cd redmine 根目录
2: # rake config/initializers/session_store.rb
3: # RAILS_ENV=production rake db:migrate
4: # RAILS_ENV=production rake redmine:load_default_data
在弹出的语言选项中选择 zh
5、启动redmine
ruby script/server webrick -e production (针对redmine1.X版本)
安装backlogs插件
1. 安装git-core,用于从git中下载backlogs apt-get install git-core
2. cd redmine/vendor/plugins(针对redmine1.x版本,如果是2.x则切换到redmine/plugins)
3. git clone git://github.com/backlogs/redmine_backlogs.git 这会创建一个redmine_backlogs文件夹
4. cd redmine_backlogs下
5. 使用 git tag 命令查看可使用的版本
6. git checkout v0.8.1 (此处使用0.8.1)
7.安装各种gem
gem install holidays
gem install icalendar
gem install prawn
gem install open-uri-cached
gem install system_timer
8.apt-get install libxml2-dev
apt-get install libxslt1-dev
9. gem install nokogiri (这个太坑爹了,花了半天时间从网上找,一直下不了,后来中午吃了饭回来重新执行又OK了。shit)
10. 安装插件: rake redmine:backlogs:install RAILS_ENV=production
问题:
1、如果rubygem未安装成功,即gem install ** 无法安装,则执行:
apt-get install libgemplugin-ruby
2、如果无法安装gem install mysql2,是因为没有mysql和ruby的链接文件
apt-get install libmysql-ruby libmysqlclient-dev
转载请指明转自:http://randychao2008.iteye.com/admin/blogs/1733366