Posted on 2011-12-10 12:26
leekiang 阅读(544)
评论(0) 编辑 收藏 所属分类:
rails
1,安装gcc
yum install gcc
2,安装MySQL,并设置为开机自动启动。
# yum install mysql mysql-devel mysql-server
# chkconfig --levels 235 mysqld on
# /etc/init.d/mysqld start
3,安装ruby
# wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p352.tar.gz
# tar zxf ruby-1.8.7-p352.tar.gz
# cd ruby-1.8.7-p352
# ./configure
# make
# make install# ruby -v
目前ruby1.8.7最新的是p352,见ftp://ftp.ruby-lang.org/pub/ruby/1.8/
默认会安装到/usr/local/lib/ruby/
4,
安装rubygems在安装rails
之前,要先安装rubygems这个比较挑剔,在redmine安装指导(http://www.redmine.org/projects/redmine/wiki/RedmineInstall)中提到有要求,要在1.3.7 ~ 1.7.0之间,这里选择了1.6.2版。同样是下载源码安装。
# cd ~/rails_install
# 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 ,可看到版本信息。
5,安装Rails及相关gems
wget http://rubygems.org/downloads/rake-0.8.7.gem
wget http://rubygems.org/downloads/rack-1.1.0.gem
wget http://rubygems.org/downloads/rails-2.3.14.gem
wget http://rubygems.org/downloads/activesupport-2.3.14.gem
wget http://rubygems.org/downloads/activerecord-2.3.14.gem
wget http://rubygems.org/downloads/actionpack-2.3.14.gem
wget http://rubygems.org/downloads/actionmailer-2.3.14.gem
wget http://rubygems.org/downloads/activeresource-2.3.14.gem
wget http://rubygems.org/downloads/i18n-0.4.2.gem
wget http://rubygems.org/downloads/mysql-2.8.1.gem
wget http://rubygems.org/downloads/cgi_multipart_eof_fix-2.5.0.gem
wget http://rubygems.org/downloads/coderay-1.0.0.gem
gem install --local rake-0.8.7.gem
gem install --local rack-1.1.0.gem
gem install --local rails-2.3.14.gem
gem install --local mysql-2.8.1.gem
gem install --local i18n-0.4.2.gem
gem install --local cgi_multipart_eof_fix-2.5.0.gem
gem install --local coderay-1.0.0.gem
6,安装Redmine1.2.3
使用svn下载Redmine 1.2源码到/www目录中
svn co svn://rubyforge.org/var/svn/redmine/branches/1.2-stable redmine-1.2
创建Redmine数据库和redmine用户
CREATE DATABASE redmine CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'redmine';
GRANT ALL ON redmine.* TO 'redmine'@'localhost';
到database.yml文件,修改production节点的帐号和密码为redmine,注意冒号后要有空格。
到/www/redmine1.2目录下
rake config/initializers/session_store.rb
RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:load_default_data
ruby script/server webrick -p 8000 -e production
如果报错:rake aborted! no such file to load -- openssl
先yum install openssl-devel
然后到下载的ruby源码的ext/openssl目录
ruby extconf.rb (生成Makefile)
make
make install
删除已安装的ruby
How to uninstall Ruby from /usr/local?How to Remove an Old version of Ruby参考:
CentOS 6.0 安装配置rails 2.3.11 + redmine 1.2.1 笔记Redmine在Linux(CentOS)下的安装及配置"./configure && make && make install"是典型的使用GNU的AUTOCONF和AUTOMAKE产生的程序的安装步骤。
./configure是用来检测你的安装平台的目标特征的。比如它会检测你是不是有CC或GCC,并不是需要CC(cc是gcc的连接,gcc是编译器)或GCC,它是个shell脚本
make是用来编译的,它从Makefile中读取指令,然后编译。
make install是用来安装的,它也从Makefile中读取指令,安装到指定的位置。
AUTOMAKE和AUTOCONF是非常有用的用来发布C程序的东西