Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7404315
  • 博文数量: 1756
  • 博客积分: 18684
  • 博客等级: 上将
  • 技术积分: 16232
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-02 10:28
个人简介

啥也没写

文章分类

全部博文(1756)

文章存档

2024年(2)

2023年(44)

2022年(39)

2021年(46)

2020年(43)

2019年(27)

2018年(44)

2017年(50)

2016年(47)

2015年(15)

2014年(21)

2013年(43)

2012年(143)

2011年(228)

2010年(263)

2009年(384)

2008年(246)

2007年(30)

2006年(38)

2005年(2)

2004年(1)

分类: LINUX

2008-12-18 17:21:40

昨天在 CentOS 安裝Ruby on Rails 的時候,我發現到雖然用 RubyWorks 來安裝很快,但是有些小細節還是得注意。所以還是寫一個 Tutorial 好了。
 
1. 安裝 RubyWorks
安裝 RubyWorks Repo
wget
sudo rpm --import public_key.txt
wget
cp RubyWorks.repo /etc/yum.repos.d/
用 yum 安裝 RubyWorks
yum install rubyworks
安裝好 RubyWorks ,他會把 ruby,rubygems,Mongrel,Haproxy,Monit 安裝跟設定好。但是他不會安裝 Rails ,而是 copy 一份 Rails 在 /usr/rails 上面,這其實是很正確的作法,因為他一開始就取向 Production Server,而 Production Server 本來就該將 Rails 版本 Freeze 在 Rails Doc 裡面。但是如果還是要在 CentOS 安裝 Rails Gem,那就
gem i rails -y
即可。
2. 安裝 MySQL
RubyWorks 好歸好,就是沒有選擇讓我們裝 DB Server,我們這裡就直接用 yum 安裝 MySQL
yum install mysql-server
3. 安裝 Ruby MySQL Native Lib
我發現到 RubyWorks 並不會安裝 Ruby MySQL Native Lib,所以我們得用 gem 安裝,但是又發現 centos 上面安裝 MySQL Gem 會出現這樣的錯誤訊息,網路上也有人在 complian。
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lm… yes
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lz… yes
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lsocket… no
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lnsl… yes
checking for mysql_query() in -lmysqlclient… no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
–with-opt-dir
所以得先 remove MySQL 然後再重新安裝 MySQL 跟 MySQL Development Lib
yum remove mysql
yum install mysql
yum install mysql-devel
gem install mysql
至於為何這樣,我也不太清楚。反正 work 就好啦。
這樣應該就安裝完成了。
阅读(1641) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~