1.安装gcc
yum install gcc-c++
yum install flex autoconf zlib curl zlib-devel curl-devel bzip2 bzip2-devel ncurses-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel pam-devel
2.安装ruby
wget http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6-p286.tar.gz
tar
tar zxvf ruby-1.8.6-p286.tar.gz
cd ruby-1.8.6-p286
./configure
make
make install
3.安装gems
wget http://rubyforge.org/frs/download.php/38646/rubygems-1.2.0.tgz
tar zxvf ruby-1.8.6-p286.tar.gz
tar zxvf rubygems-1.2.0.tgz
cd rubygems-1.2.0
ruby setup.rb
4.安装rails
gem install rails
5.安装rmagick(转载Lighty RoR)
6.安装mysql
yum install mysql
yum install mysql-devel
7.安装phpmyadmin
8.ruby C版本的数据库适配器
下载mysql-ruby-2.7.3.tar.gz:
http://www.tmtm.org/en/mysql/ruby/
tar xzvf mysql-ruby-2.7.3.tar.gz
cd mysql-ruby-2.7.3
ruby extconf.rb --with-mysql-dir=/usr/share/mysql/ --with-mysql-lib=/usr/lib/mysql/ --with-mysql-include=/usr/include/mysql
make && make install
9.部署
yum install httpd-devel
passenger-install-apache2-module
yum install gcc-c++
yum install flex autoconf zlib curl zlib-devel curl-devel bzip2 bzip2-devel ncurses-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel pam-devel
2.安装ruby
wget http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6-p286.tar.gz
tar
tar zxvf ruby-1.8.6-p286.tar.gz
cd ruby-1.8.6-p286
./configure
make
make install
3.安装gems
wget http://rubyforge.org/frs/download.php/38646/rubygems-1.2.0.tgz
tar zxvf ruby-1.8.6-p286.tar.gz
tar zxvf rubygems-1.2.0.tgz
cd rubygems-1.2.0
ruby setup.rb
4.安装rails
gem install rails
5.安装rmagick(转载Lighty RoR)
RMagick 需要
1. FreeType
2. Ghostscript fonts
3. JPEG
4. PNG
5. WMF
這幾個 Image Lib ,當我確認過 CentOS 都有安裝這些 Lib 之後,很可惜的,Error 一再的出現,就這樣陷入了一再重複的地獄。最後我從這個網頁發現到
CentOS 預設 FreeType Lib 是爛掉的。
這就是最後的解答。So,請下載 FreeType 的 Lib ,重新 compile ,然後 RMagick 就會成功。
1. 安裝 GCC / G++
yum install gcc-c++ compat-gcc-32 compat-gcc-32-c++
2. Install 相關 lib
yum install glib glib2 zlib-devel libpng libjpeg libtiff ghostscript
3. 下載 FreeType 2.3.5 ,make
4. 下載 ImageMagick,make
你可以用 convert --version 確認是否安裝成功
5. gem i rmagick
你可以用
ruby -rrubygems -e "require 'RMagick'; puts Magick::Long_version;"
確認是否安裝成功。
6.安装mysql
yum install mysql
yum install mysql-devel
7.安装phpmyadmin
8.ruby C版本的数据库适配器
下载mysql-ruby-2.7.3.tar.gz:
http://www.tmtm.org/en/mysql/ruby/
tar xzvf mysql-ruby-2.7.3.tar.gz
cd mysql-ruby-2.7.3
ruby extconf.rb --with-mysql-dir=/usr/share/mysql/ --with-mysql-lib=/usr/lib/mysql/ --with-mysql-include=/usr/include/mysql
make && make install
9.部署
yum install httpd-devel
passenger-install-apache2-module