一、安裝ruby
站在用戶(hù)的角度思考問(wèn)題,與客戶(hù)深入溝通,找到雁江網(wǎng)站設(shè)計(jì)與雁江網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗(yàn),讓設(shè)計(jì)與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個(gè)性化、用戶(hù)體驗(yàn)好的作品,建站類(lèi)型包括:網(wǎng)站建設(shè)、網(wǎng)站設(shè)計(jì)、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣、申請(qǐng)域名、網(wǎng)絡(luò)空間、企業(yè)郵箱。業(yè)務(wù)覆蓋雁江地區(qū)。
下載ruby-1.8.7
http://www.ruby-lang.org/en/downloads
#tar xzvf ruby-1.8.7.tar.gz
#cd ruby-1.8.7
#./configure --prefix=/usr/local/ruby
#make && make install
設(shè)置環(huán)境變量 vim /etc/profile
export PATH=/usr/local/ruby/bin:$PATH
二、安裝rubygems
如果系統(tǒng)中已經(jīng)存在rubygems,可以通過(guò)如下方法卸載:
#ruby -e 'puts $:'//查找rubygems安裝目錄
#cd /usr/local/ruby/lib/ruby/site_ruby/1.8/
#rm -rf ubygems.rb rubygems rubygems.rb
#which gem gem1.8//查找gem包的安裝目錄
#rm -rf /usr/local/ruby/bin/gem
下載rubygems-1.6.0
https://rubyforge.org/frs/?group_id=126&release_id=46730
#tar zxvf rubygems-1.6.0.tgz
#cd rubygems-1.6.0
#ruby setup.rb
#gem -v//查看版本
注意:開(kāi)始時(shí)把rubygems更新到最新版本1.6.2了,最后用rake創(chuàng)建表時(shí)失敗,郁悶。
安裝完rubygems后注意修改更新站點(diǎn),否則有的包可能無(wú)法正常安裝。
#gem source -r http://gems.rubyforge.org 刪除以前的更新站點(diǎn)
#gem source -a http://rubygems.org 添加現(xiàn)在的更新站點(diǎn)
三、安裝rails
#gem install rails -v=2.3.11
四、安裝i18n
#gem install i18n -v=0.4.2
Fetching:i18n-0.4.2.gem (100%)
Successfully installed i18n-0.4.2
1 gem installed
Installing ri documentation for i18n-0.4.2...
Installing RDoc documentation for i18n-0.4.2...
五、安裝ruby-MySQL
#gem install ruby-mysql
Successfully installed ruby-mysql-2.9.4
1 gem installed
Installing ri documentation for ruby-mysql-2.9.4...
Installing RDoc documentation for ruby-mysql-2.9.4...
六、補(bǔ)充 mysql的安裝:
創(chuàng)建mysql用戶(hù)名,用戶(hù)組
# groupadd mysql
# usradd -g mysql mysql
下載mysql源碼 http://www.mysql.com/downloads/mysql
#cd mysql-5.0.22
#./configure --prefix=/usr/local/mysql
--datadir=/mydata //數(shù)據(jù)庫(kù)存放目錄
--with-charset=utf8 //使用UTF8格式
--with-extra-charsets=complex //安裝所有的擴(kuò)展字符集
--enable-thread-safe-client //啟用客戶(hù)端安全線程
--with-big-tables //啟用大表
--with-ssl //使用SSL加密
--with-embedded-server //編譯成embedded MySQL library (libmysqld.a )
--enable-local-infile //允許從本地導(dǎo)入數(shù)據(jù)
--enable-assembler //匯編x86的普通操作符,可以提高性能
--with-plugins=innobase //數(shù)據(jù)庫(kù)插件
--with-plugins=partition //分表功能,將一個(gè)大表分割成多個(gè)小表
#make && make install
初始化mysql數(shù)據(jù)庫(kù)
#chown -R mysql:mysql /usr/local/mysql
#cp mysql-5.0.22/support-files/my-medium.cnf /etc/my.cnf
#cd /usr/local/mysql
#bin/mysql_install_db --user=mysql
#chown -R mysql:mysql /usr/local/mysql/var/ //把初始化的數(shù)據(jù)庫(kù)目錄給MySQL所有者
#/usr/local/mysql/bin/mysqld_safe --user=mysql & //啟動(dòng)MySQL
配置開(kāi)機(jī)自動(dòng)啟動(dòng)
#cp mysql-5.0.22/support-files/mysql.server /etc/init.d/mysqld
#chmod 755 /etc/init.d/mysqld
#chkconfig --add mysqld
#chkconfig mysqld on
#service mysqld restart
補(bǔ)充 mysql的配置:
配置my.cnf
配置主要把安裝的目錄的那幾項(xiàng)打開(kāi)就行.
改動(dòng)如下:
[client]
#password = your_password
port = 3306
socket = /tmp/mysql3306.sock
# The Mysql server
[Mysqld]
port = 3306
socket = /tmp/mysql3306.sock
打開(kāi)下面幾項(xiàng)
innodb_data_home_dir = /usr/local/mysql/var/
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /usr/local/mysql/var/
innodb_log_arch_dir = /usr/local/mysql/var/
七、安裝redmine
http://rubyforge.org/frs/?group_id=1850
注意redmine的版本,此處是以1.2.1為例子的
具體版本信息要求請(qǐng)看http://www.redmine.org/projects/redmine/wiki/RedmineInstall?version=146
下載redmine-1.2.1
解壓放到/usr/local/redmine下
#cd /usr/local/redmine/config
#cp database.yml.example database.yml
#vim database.yml //數(shù)據(jù)庫(kù)配置文件
production:
adapter: mysql
database:redmine
host: localhost
username: root //數(shù)據(jù)庫(kù)訪問(wèn)用戶(hù)名
password: "123456" //數(shù)據(jù)庫(kù)訪問(wèn)密碼
encoding: utf8
使用rake創(chuàng)建表
# rake db:migrate RAILS_ENV="production"
a.報(bào)錯(cuò):uninitialized constant ActiveSupport::Dependencies::Mutex
解決方法:rails和rubygems版本不匹配,rubygems降到1.3.5試試
b.報(bào)錯(cuò):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
c.報(bào)錯(cuò): No such file or directory - /tmp/mysql.sock
解決方法: 由于之前在mysql配置時(shí)my.cnf配置了socket導(dǎo)致
vim config/database.yml
在production欄目最后一行添加 socket: /tmp/mysql3306.sock
注意: socket的“:"后面必須有個(gè)空格,再接"/tmp/mysql3306.sock"
d.報(bào)錯(cuò):
!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.
rake aborted!
需要安裝mysql適配器。gem install mysql
e.報(bào)錯(cuò):
Access denied for user 'mysql'@'localhost' (using password: YES)
解決辦法:
#mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.22-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
mysql>grant all privileges on *.* to 'mysql'@'localhost' identified by 'mysql' with grant option;
mysql>flush privileges;
mysql>exit;
f.報(bào)錯(cuò):Unknown database 'redmine'
解決辦法:創(chuàng)建數(shù)據(jù)庫(kù)redmine
mysql>create database redmine;
加載默認(rèn)配置
# rake redmine:load_default_data RAILS_ENV="production"
這里會(huì)要求選擇默認(rèn)語(yǔ)言,選中文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
這個(gè)默認(rèn)設(shè)置只是在未登錄時(shí)的界面語(yǔ)言,當(dāng)用戶(hù)登錄后,默認(rèn)語(yǔ)言還是英語(yǔ),在My account里可以修改成其它語(yǔ)言。
啟動(dòng)WEB服務(wù)
# ruby script/server webrick -e production
或# ruby /usr/local/redmine/redmine-1.0/script/server webrick -e production
更換web服務(wù)器
redmine自帶的webrick太慢,特別是局域網(wǎng),據(jù)說(shuō)是需要解析目標(biāo)地址的主機(jī)名,直接給ip不用,硬要繞一圈。
使用網(wǎng)上推薦的 mongrel
# gem install mongrel
# ruby /usr/local/redmine/script/server mongrel -e production
本機(jī)ip為192.9.100.106,至此在本機(jī)使用http://192.9.100.106:3000 或 http://127.0.0.1:3000均能訪問(wèn),但局域網(wǎng)其他機(jī)器仍然無(wú)法訪問(wèn)。
原因:redhat防火墻屏蔽了端口3000
解決辦法: 配置防火墻,開(kāi)放寬口3000
# /sbin/iptables -I INPUT -p tcp --dport 3000 -j ACCEPT
# /etc/rc.d/init.d/iptables save
# service iptables restart
至此,redmine安裝完成。
八、Redmine郵件的配置
進(jìn)入config目錄下
cp configuration.yml.example configuration.yml
然后修改信息如下:
default:
# Outgoing emails configuration (see examples above)
email_delivery:
delivery_method: :async_smtp
smtp_settings:
#tls: true
address: smtp.XXX.com
port: 25
domain: XXX.com
authentication: :login
user_name: "XXX@XXX.com"
password: "XXX"
重啟服務(wù),然后在redmine的管理》配置》郵件通知中開(kāi)啟即可
文章名稱(chēng):linux下安裝redmine1.2.1全記錄
URL鏈接:http://m.rwnh.cn/article10/jdgddo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站內(nèi)鏈、定制網(wǎng)站、云服務(wù)器、建站公司、小程序開(kāi)發(fā)、面包屑導(dǎo)航
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)