CentOS 6.0 安装配置rails 2.3.11 + redmi
没想到安装过程这么曲折,gem安装时下载经常是不成功的,无耐只好把.gem文件下载回来再本地安装,加上radmine 1.2.1对各组件的版本了也比较挑剔,中间走了不少弯路,折腾了二天时间,终于摸清路子。顺便把安装方法记录下来。
0.安装相关的软件包
1:# yum install httpd httpd-devel openssl-devel\ zlib-devel gcc gcc-c++ curl-devel subversion -y
1.安装MySql数据库
安装MySQL ,并设置为开机自动启动。
1: # yum install mysql mysql-devel mysql-server 2: # chkconfig --levels 235 mysqld on 3: # /etc/init.d/mysqld start
创建Redmine数据库,执行mysql -u root -p登录mysql,在mysql>命令行中输入如以下sql代码:
1: CREATE DATABASE redmine CHARACTER SET utf8 COLLATE utf8_general_ci; 2: CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'redmine'; 3: GRANT ALL ON redmine.* TO 'redmine'@'localhost';
添加一个数据库readmine,创建一个用户登录用户redmine,密码和用户名相同,并且授权访问redmine数据库。
注:mysql安装后默认root是没设置密码的,如果要改root密码,执行usr/bin/mysqladmin -u root password 'new-password' 修改。
2.安装Ruby 1.8.7
下载Ruby1.8.7源码编译安装,建个临时目录存放安装过程需要下载的文件
1:# mkdir ~/rails_install 2:# cd ~/redmine_install 3:# wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p352.tar.gz 4:# tar zxvf ruby-1.8.7-p352.tar.gz 5:# cd ruby-1.8.7-p352 6:# ./configure 7:# make 8:# make install
安装成功后执行ruby –v 可看到ruby的版本信息,如:
ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-linux]
3.安装RubyGems
这个比较挑剔,在redmine安装指导(http://www.redmine.org/projects/redmine/wiki/RedmineInstall)中提到有要求,要在1.3.7~ 1.7.0之间,这里我选择了1.6.2版。同样是下载源码安装。
1:# cd ~/rails_install 2:# wget http://rubyforge.org/frs/download.php/74445/rubygems-1.6.2.tgz 3:# tar zxvf rubygems-1.6.2.tgz 4:# cd rubygems-1.6.2 5:# ruby setup.rb
安装成功后,执行gem –v ,可看到版本信息。
4.安装Rails及相关gems
如果直接用gem install xxx 安装的,大都都安装不成功,不知是我这边网络问题还是其它原因,所以只好把用到的文件都下载回来再本地安装。
1: # 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
安装成功后运行rails可以看到相应的版本信息
5.安装Red
相关新闻>>
- 发表评论
-
- 最新评论 更多>>