源码编译安装ruby-2.2
1、获取源码包;
wget http://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.2.tar.gz
2、安装依赖包
sudo apt-get install -y build-essential openssl curl libcurl3-dev libreadline6 libreadline6-dev git zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev autoconf automake libtool imagemagick libmagickwand-dev libpcre3-dev libsqlite3-dev
3、解压
tar -zxvf ruby-2.2.2.tar.gz -C .
4、进入源码包
cd ruby-2.2.2
5、新建安装目录
mkdir /urs/local/ruby
6、编译
./configure -prefix=/usr/local/ruby
7、安装
sudo make && sudo make install
8、配置系统环境变量
sudo vim /etc/environment
在PATH后加入:/urs/local/ruby/bin
source /etc/environmet
9、检测
ruby --version
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
时间: 2024-10-07 11:13:15