CentOS下源码安装Ruby及Go

安装依赖

1
yum install wget gcc gcc-c++ g++ autoconf autoconf2.13 automake make cmake m4 openssl openssl-devel curl libcurl-devel zlib-devel libxml2-devel gettext-devel gdbm-devel readline-devel ncurses-devel libffi-devel libyaml-devel libxslt-devel libicu-devel logrotate python-docutils krb5-devel

安装Ruby

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# rpm -qa | grep -i ruby
# wget https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.1.tar.gz
# tar -xzf ruby-2.4.1.tar.gz
# cd ruby-2.4.1/
# ./configure --prefix=/usr/local/ruby --disable-install-rdoc
# make
# make install
# ln -s /usr/local/ruby/bin/ruby /usr/bin/ruby //放在/usr/local/bin/目录下只能为当前用户识别,放在/usr/bin/目录下可以为所有用户识别
# ln -s /usr/local/ruby/bin/gem /usr/bin/gem
# ruby -v
# gem -v
# gem sources --remove https://rubygems.org/ //最好不要删除默认源
# gem sources -a https://ruby.taobao.org/ //修改ruby的源为淘宝
# gem sources -u //更新缓存
# gem sources -l //列出源
# gem install bundler --no-ri --no-doc
# ln -s /usr/local/ruby/bin/bundle /usr/bin/bundle
# bundle -v

安装Go

1
2
3
4
# wget https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz
# tar -xzf go1.8.3.linux-amd64.tar.gz -C /usr/local/
# ln -sf /usr/local/go/bin/{go,godoc,gofmt} /usr/bin/ //放在/usr/local/bin/目录下只能为当前用户识别,放在/usr/bin/目录下可以为所有用户识别,后面的git用户就要用到go
# go version

Powered by AppBlog.CN     浙ICP备14037229号

Copyright © 2012 - 2020 APP开发技术博客 All Rights Reserved.

访客数 : | 访问量 :